阅读背景:

是否有一种简单的方法可以获得两个数的幂?

来源:互联网 

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?If I have a number that I am certain is a power




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: