|
int x = 0; // There is no initialization x, the discussion is meaningless, so the following discussion assumes that x is initialized to 0
(x&1) == 0 according to logical AND
(x | 1) == 1 according to logical OR
(x% 2) == 0 is equivalent to (x&1)
(~ (~ 0U << 2)) == 3 0 is inverted, all bits are 1, and then shifted to the left by two bits, then the next two bits are 0, and then inverted, then the first 1 is all 0, the latter Get two 1s, converted to decimal 3 |
|