Question: x is power of 2?
Answer: If x is a power of two, its lone 1 bit is in position n . This means x – 1 has a 0 in position n . To see why, recall how a binary subtraction works. When subtracting 1 from x , the borrow propagates all the way to position n ; bit n becomes 0 and all lower bits become 1.