-
Notifications
You must be signed in to change notification settings - Fork 2
modp
Subhajit Sahu edited this page Aug 9, 2022
·
6 revisions
Find the remainder of x/y with +ve sign (euclidean division).
function modp(x, y)
// x: dividend
// y: divisor
const xbigint = require('extra-bigint');
xbigint.modp(1n, 10n);
// → 1n
xbigint.modp(-1n, 10n);
// → 9n
xbigint.modp(1n, -10n);
// → 1n