% Modulo
In this section:
Precedence
4
Description
% or MOD produces the remainder from the integer division of the left operand by the right operand. The operands are taken as signed 32-bit integers, and the result is also a signed 32-bit integer.
X % Y is equivalent to X-Y*(X/Y) using integer division.
Example
2 % 2 –> 0 12 % 7 –> 5 3 % 2 –> 1