Write an algorithm to test if n is power of 2
Anonymous
I believe what the other poster meant was the following: !(n & (n-1)) !(n & 0x00000001) is equivalent to !(n&1) and is independent of integer size. However, this only checks if a number is even.
Check out your Company Bowl for anonymous work chats.