Quote:
|
Originally Posted by jake13jake
Tell me, why would you write
if( (x==2) || (x==3) || (x==5) || (x==7) )
When you could write
if( (1<<x) & ((1<<2)|(1<<3)|(1<<5)|(1<<7) )
I'll tell you what though, I've only been recently learning how to use bitwise operators.
|
Because the compiler would interpret those as bitwise operators. if(function()) is doing an '== true' check, if(function() == true) is
NOT doing two checks for true. If you honestly think I am wrong in this, then you would think that if(function() == false) is doing a check for both true and false.
Read my damn text before you reply. I am done with this thread.