The function most-significant bit msb(n) returns the index of the highest 1 bit in the integer n.

MSB can be resolved using integer algorithm to find the rank in the array of all the powers of 2.