2 ms·
Considering ASCII 'C', 'c', and '3', they have the binary expansions 001000011 001100011 000110011 Notably, that third bit is what shows whether it's ni
by schoen 9y ago
Considering ASCII 'C', 'c', and '3', they have the binary expansions
001000011
001100011
000110011
Notably, that third bit is what shows whether it's nibble value 8+3=11 or just plain nibble value 3. The binary 11 that gives us the 3 is way over at the right.
The way I would think of doing this in terms of bit operations is
(c & 7) | ((c&64)>>3)
However, they're apparently doing the (c&64)>>3 part with the multiplication somehow and I haven't quite understood how that happens.