If I have a number that I am certain is a power of two, is there a way to get which power of two the number is? I have thought of this idea: Having a count and shifting the number right by 1 and incrementing the count until the number is 0. Is there another way, though? Without keeping a counter?
Edit: Here are some examples: 8 -> returns 3 16 -> returns 4 32 -> returns 5