Sha256: 5376f57802b67b74f2f0c2649e30c8f12a4ffb2930ff1fda6d8e977d1ecf4339
Contents?: true
Size: 706 Bytes
Versions: 112
Compression:
Stored size: 706 Bytes
Contents
'use strict'; var GetIntrinsic = require('get-intrinsic'); var $BigInt = GetIntrinsic('%BigInt%', true); var $RangeError = GetIntrinsic('%RangeError%'); var $TypeError = GetIntrinsic('%TypeError%'); var Type = require('../Type'); var zero = $BigInt && $BigInt(0); // https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-remainder module.exports = function BigIntRemainder(n, d) { if (Type(n) !== 'BigInt' || Type(d) !== 'BigInt') { throw new $TypeError('Assertion failed: `n` and `d` arguments must be BigInts'); } if (d === zero) { throw new $RangeError('Division by zero'); } if (n === zero) { return zero; } // shortcut for the actual spec mechanics return n % d; };
Version data entries
112 entries across 30 versions & 4 rubygems