Skip to content

modEuclid

modEuclid(value, modulus): number

Defined in: packages/core/src/number/integer/mod-euclid.ts:10

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

Differs from mod only when modulus is negative, where the floored remainder follows the modulus’ sign and this one stays non-negative: mod(-7, -2) is -1, modEuclid(-7, -2) is 1.

number

number

number

When modulus is zero.