Skip to content
Subhajit Sahu edited this page Jun 25, 2020 · 6 revisions

Gets remainder of x/y with +ve sign (euclidean division). 🏃 📼 📦 🌔 📒

Similar: rem, mod, modp.

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

bigint.modp(1n, 10n);
// 1n

bigint.modp(-1n, 10n);
// 9n

bigint.modp(1n, -10n);
// 1n

references

Clone this wiki locally