U
U
uvelichitel2015-04-28 16:28:32
Programming
uvelichitel, 2015-04-28 16:28:32

Is it possible to determine the power of two (bit number) with one bitwise operation (without cyclic shift)?

Everything is in the header.
How to get 0001000000 from
0001000000==128 -> 7 without

for n>0; k++{
n<<1
}
return k

Maybe?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Antony, 2015-04-28
@uvelichitel

If you do not have at hand some specific processor (or ALU) that has such an operation, no way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question