Question: Please explain this bit-wise operation line by line /* * greatestBitPos - return a mask that marks the position of the most significant 1 bit.
Please explain this bit-wise operation line by line

/* * greatestBitPos - return a mask that marks the position of the most significant 1 bit. If x == 0, return 0 * Example: greatestBitPos (96) = 0x40 * Legal ops: ! ^&^ + > * Max ops: 70 * Rating: 4 */ int greatestBitPos(int x) { int t = x; int no = 0; int 10 = !(t >> 16); int n = 10 > 24); n = 10 > 28); n = 10> 30); n = 10 > 31) + !(t >> 30); return !!x (32 + ~00); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
