Can I make a function int bitParity(int x) that returns 1 if x contains an odd number of 0's using only these operators? ! ~ & ^ | + << >>
views:
83answers:
1
+2
A:
Hey, it was exactly three clicks. google -> 1.st result - wiki/Parity_bit -> external link -> http://graphics.stanford.edu/~seander/bithacks.html#ParityNaive
Krab
2010-02-23 17:00:11