Possible Duplicate:
Find if every even bit is set to 0 using bitwise operators
The other example didnt really answer my question so here is the situation:
I need to return 1 if all evens in the bit sequence are set to 0 and return 0 otherwise. -I cant use conditional statements!
So I have a number 0x7f (01111111)
I can and by a mask of 0xAA(10101010)
that gives me: 00101010
I need to do only a 0 or 1 so I !!(00101010) and that will give me the boolean value for it but it returns a 1 but I need a 0 so I can negate it or use a different mask.
I keep going in circles with this and its driving me nuts please help and remember no conditional statements just these operators:
! ~ & ^ | + << >>