Remainder

Syntax

x % y

Explanation

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.

Examples

16 % 16  // 0
17 % 16  // 1
18 % 16  // 2
-16 % 16 // 0

Last updated