Skip to content

bigIntModEuclid

bigIntModEuclid(dividend, divisor): bigint

Defined in: packages/core/src/big-int/mod-euclid.ts:12

Euclidean remainder — always in [0, |divisor|), whatever the signs.

Differs from bigIntMod only when divisor is negative, where the floored remainder follows the divisor’s sign and this one stays non-negative: bigIntMod(-7n, -2n) is -1n, bigIntModEuclid(-7n, -2n) is 1n.

bigint

bigint

bigint

When divisor is zero.