Skip to main content

modulo(x: any, y: any): number

Gets the modulo of dividing two given NumberLikes.

remarks

In most languages, ‘%’ is a remainder operator, but in some (e.g. Python, Perl) it is a modulo operator. For positive values, the two are equivalent, but when the dividend and divisor are of different signs, they give different results.

see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Remainder

Parameters:#

NameTypeDescription
xanyThe dividend.
yanyThe divisor.

Returns: number

number - The resulting modulo.

Defined in: unsafe/math/modulo.ts:15

Last updated on