Hi GURUs,

I want to be able to find out whether a specific number is 2^x or not.

For example:
64 --> yes, it is a 2^6
32 --> yes, it is a 2^5
24 --> no, because it is not part of 2 power of x.
8 --> yes, because it is 2^3
6 --> no, because it is not a 2 power of x.

My question is, given a specific a number, how to determine if it is a 2^x value or not?

I know the hard way which is do a loop until the value we want to find is greater than 2^x.

Is there a more simple way to do it?

Cheers