08-11-2010, 04:43 PM
|
#2 (permalink)
|
|
The Addict
Join Date: Aug 2008
Posts: 336
Thanks: 8
|
it checks if the number $i (I am guessing $i value's is a number) is odd or even/
The modular or mod (%) returns the reminder of the division, such as if the statement is 4%3 it would be the reminder of the 4/3 division which in this case example is 1.
On the example code you gave if anything divided by 2 doesn't return 0 then the nominator is odd. I think it is a mathematical way to find odd or even numbers.
|
|
|
|