@extra-bigint/mod

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 extraBigintMod from 'https://cdn.skypack.dev/@extra-bigint/mod';
</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.


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