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