A way to find out how many bits are required to store a signed int

I was wondering if there is a way to find how many bits are required to store a signed integer without using comparison operator and any loops or special functions.

Just by using ! | << >> + and other binary operators.


Source: c++

Leave a Reply