Use this function to get the index of the most significant (set) bit in a 32-bit number. This is also the same as the base 2 logarithm of the number.
x |
the number to find the MSB of |
Returns the index of the most significant bit of x, or -1 if x is 0.