Question: Please explain this bit-wise operation line by line * * /* * fits Bits return 1 if x can be represented as an * n-bit,
Please explain this bit-wise operation line by line

* * /* * fits Bits return 1 if x can be represented as an * n-bit, two's complement integer. 1 > Max ops: 15 Rating: 2 */ int fitsBits (int x, int n) { X >>= ~(~n + 1); return (!x | !(x+1)); } /* * isNegative return 1 if x > * Max ops: 6 Rating: 2 */ int isNegative(int x) { x = x >> 31; return !!x; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
