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