Is *0* even or is zero odd?

Zero is an even number. It is true that when it comes to classifying zero as a positive or negative number, one would explain how zero is not positive nor negative. However, when it come to being an *odd* or *even* integer is another matter.

The easy way to remember why zero is an even number is to think this way:

- Is the number that comes after zero an even number, or an odd number?

*Answer:*after zero comes an odd number, which is*1*. - What about before zero, is the number odd or even?

*Answer:*before zero the number is odd because it is*-1*.

Let’s prove this is so.

Fire up your ** Chrome** or

**console by pressing**

*Opera***CTRL SHIFT j**

Try the following code and observe the results:

-1 % 2 === 0; // returns false 1 % 2 === 0; // returns false 0 % 2 === 0; // returns true

Note: *%* represents the *modulus* or the remainder of the division between the left and right values. When the remainder is zero in a division by 2, the number being divided is an even number. Else, the number is odd.

Advertisements