If the operation X modulo 2 = 0, the function returns true - this means that the number is even.
The modulo 2 operation returns the remainder of dividing by 2.
Example:
5 % 2 = 1, because 5 = 2*2 + 1
7 % 2 = 1because use 7 = 3*2 + 1
6 % 2 = 0, because 6 = 3*2 + 0
br33f source
share