Skip to content
Subhajit Sahu edited this page Aug 9, 2022 · 2 revisions

Find the least common multiple of bigints.

Similar: gcd, lcm.


function lcm(...xs)
// xs: a list of bigints

const xbigint = require('extra-bigint');


xbigint.lcm(2n, 3n);
// → 6n

xbigint.lcm(2n, 3n, 4n);
// → 12n

xbigint.lcm(2n, 3n, 4n, 5n);
// → 60n


References

Clone this wiki locally