Joined October 2012
·

Sanket Sudake

Posted to Check if number power of 2 over 1 year ago

Thankx for pointing it out. I written that in hurry, so made a mistake. I have updated tip.
In case of 8 ,
a & (a - 1) == false
So number is power of 2.

1 )For false == number is power of 2
2) For true == number is not power of 2

Achievements
133 Karma
8,752 Total ProTip Views