RE: [PHP] Is it odd or even??? Optimize!!!

2001-03-05 Thread Nathan Cassano
You all are a bunch of un-optimizing novices. Just do some bit banging. i.e. if(1 number){ echo "$number is odd"; }else{ echo "$number is even"; } -Original Message- From: Brandon Orther [mailto:[EMAIL PROTECTED]] Sent: Monday, March 05, 2001 12:18 PM To: PHP User

Re: [PHP] Is it odd or even??? Optimize!!!

2001-03-05 Thread Julian Wood
Clever. For those of us unfamiliar with bitwise ops, here's how this works: The bitwise and op () works on bits like this: dig1 dig2 Result 000 010 100 111 An even number's binary representation always ends with 0 (ie 12 = 1100) while an odd ends with 1 (ie 13