Skip to content
Subhajit Sahu edited this page Aug 9, 2022 · 4 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 xbigint = require('extra-bigint');


xbigint.rem(1n, 10n);
// → 1n

xbigint.rem(-1n, 10n);
// → -1n

xbigint.rem(1n, -10n);
// → 1n


References

Clone this wiki locally