The modulo operator computes the remainder of the division between two operands. The modulo operator is defined for Byte
, Short
, Integer
and Long
. The result of x Mod y
is the value produced by x – (x / y) * y
. If y
is zero, a System.DivideByZeroException
exception is thrown. The modulo operator never causes an overflow.
Mod
Expression