@extra-bigint/mod.min

Gets remainder of x/y with sign of y (floored division). 📦 NPM, 😺 GitHub, 🏃 RunKit, 🌔 Minified, 📜 Files, 📰 JSDoc, 📘 Wiki.

Usage no npm install needed!

<script type="module">
  import extraBigintModMin from 'https://cdn.skypack.dev/@extra-bigint/mod.min';
</script>

README

Gets remainder of x/y with sign of y (floored division).
📦 NPM, 😺 GitHub, 🏃 RunKit, 🌔 Minified, 📜 Files, 📰 JSDoc, 📘 Wiki.

Similar: rem, mod, modp.

This is part of package extra-bigint.

This is browserified, minified version of @extra-bigint/mod.
It is exported as global variable bigint_mod.
CDN: unpkg, jsDelivr.


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

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

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

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


References