Skip to content
Subhajit Sahu edited this page Aug 8, 2022 · 15 revisions

Find the remainder of x/y with sign of x (truncated division).

Similar: rem, mod, modp.


function rem(x, y)
// x: dividend
// y: divisor

const xmath = require('extra-math');


xmath.rem(1, 10);
// → 1

xmath.rem(-1, 10);
// → -1

xmath.rem(1, -10);
// → 1


References

Clone this wiki locally