Hello, assuming I have a value of n that is a power of 2, what is the quickest way to find which bit is set?
Is there anything faster than a simple iteration such as
int temp = 0;
for (int i = n; i > 1; i >>= 1, temp++) { }
Thanks
Loading
Replies
Know the answer? Post it — somebody with the same question will find it here.