-
Notifications
You must be signed in to change notification settings - Fork 0
gcd
Subhajit Sahu edited this page Aug 9, 2022
·
2 revisions
Find the greatest common divisor of numbers.
function gcd(...xs)
// xs: a list of numbers
const xnumber = require('extra-number');
xnumber.gcd(6, 15);
// → 3
xnumber.gcd(6, 15, 21);
// → 3
xnumber.gcd(6, 15, 20);
// → 1