php - Is zero (0) an even or odd number? -


not request code of type.

let's randomly generating number between 0 , ten , doing until receive number. 0 available result?

are evens 0-10:

2, 4, 6, 8, 10 

-or-

0, 2, 4, 6, 8, 10 

mathematically, 0 even. php has no built-in notion of even.

a (mathematically correct) test parity checking if number vanishes mod 2. test implemented $number % 2 == 0. 0 can check 0 mod 2 0, , considered even.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -