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

Gets remainder of x/y with +ve sign (euclidean division). 🏃 [:vhs:] 📦 🌔 📒

Similar: [rem], [mod], [modp].

bigint.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