Ch 2 - Ex 2
The solution given to this in the Word document seems to provide the quotient * 8 rather than the remainder.
So for the example of 29 the solution provided ((number >> 3) << 3) gives 24 rather than 5:
11101 >> 3 = 00011 (3)
00011 << 3 = 11000 (24)
I believe a correct solution would be (number & 7):
11101 (29)
&&&&&
00111 (7)
=====
00101 (5)
|