Skip to content
wolfram77 edited this page Mar 31, 2020 · 15 revisions

Gets remainder of x/y with sign of y (floored division).

Similar: rem, mod, modp.

math.mod(x, y);
// x: dividend
// y: divisor
const math = require('extra-math');

math.mod(1, 10);
// 1

math.mod(-1, 10);
// 9

math.mod(1, -10);
// -9

references

Clone this wiki locally