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