x % y
The remainder operator returns the remainder left over after division of the two operands. The sign of the dividend is taken rather than the divisor making it different from a modulus function.
modulus
16 % 16 // 0 17 % 16 // 1 18 % 16 // 2 -16 % 16 // 0
Last updated 5 years ago
Was this helpful?