Why does the expression n&1 == 0
always return false
, where n
is an integer?
I want to use bitwise operation to determine whether n
is even. However, it always return false. (The clion also prompted me that it always returns false
).
What's more, it works when I use n&1 != 0
to determine whether n
is odd.