Re: Odds and Evens!
| From: | Jason Murray | Date: | Tue, 22 Aug 2000 15:50:53 +0000 |
| Subject: | Re: Odds and Evens! | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-12965@lists.php.net to get a copy of this message | ||
With the % operator and the & operator, be aware that if the
variable is equal to 0, then the expression will be zero.
$a % 2 == 0
$a & 1 == 0
when $a == 0
I don't know about you, but my algebra teacher ingrained in our
still-developing little brains that "zero is neither even nor
odd".
Greetings,
Jason
--
Jason Murray
Developer
jWeb New Media Design