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