-
Notifications
You must be signed in to change notification settings - Fork 2
maxPrimeFactor
Subhajit Sahu edited this page Aug 9, 2022
·
1 revision
Find the greatest prime number which divides a bigint.
Similar: minPrimeFactor, maxPrimeFactor, primeFactors.
function maxPrimeFactor(x)
// x: a bigint
const xbigint = require('extra-bigint');
xbigint.maxPrimeFactor(1n);
// → 0n
xbigint.maxPrimeFactor(3n);
// → 3n
xbigint.maxPrimeFactor(21n);
// → 7n
xbigint.maxPrimeFactor(55n);
// → 11n
xbigint.maxPrimeFactor(53n);
// → 53n