3 ответов
+ 1
modulo
0
E.g;
10 % 3 = 1
10 % 2 = 0
0
Modulo (remainder)
This operator takes two operands, divides them, and returns the remainder.
Examples:
6%2
This is zero.
6 divided by 2 is exactly 3, no remainder.
6%4
This is two
6 divided by 4 is one, two remainder.
5%6
This is 5.
If the second operand is larger than the first, the first is returned.