To check if bit is set (equals 1) in number , you AND with . If the result is non-zero, the bit is set.
Why does this work? The number has only one bit set: bit . When you AND with , all other bits become 0. Only bit survives if it was 1 in .
Example: Check if bit 2 is set in . Compute . Non-zero, so bit 2 is set.