mod

fun mod(value: Int, modulus: Int): Int

Returns the integer modulus of a specified number. This differs from the % operator in that the result is always positive when the modulus is positive. For example -1 % 10 = -1, whereas mod(-1, 10) = 1.

Return

the remainder after dividing the number by the modulus

Parameters

value

the integer number whose modulus to compute

modulus

the modulus