3 ms·
All this talk about mental-math base conversions reminded me of the "double-dabble" algorithm, which lets you quickly convert binary to decimal in your head. >
by tdeck 11y ago
All this talk about mental-math base conversions reminded me of the "double-dabble" algorithm, which lets you quickly convert binary to decimal in your head.
> In the 1960s, the term double dabble was also used for a different mental algorithm, used by programmers to convert a binary number to decimal. It is performed by reading the binary number from left to right, doubling if the next bit is zero, and doubling and adding one if the next bit is one.[4] In the example above, 11110011, the thought process would be: "one, three, seven, fifteen, thirty, sixty, one hundred twenty-one, two hundred forty-three," the same result as that obtained above.
https://en.wikipedia.org/wiki/Double_dabble#Historical https://en.wikipedia.org/wiki/Double_dabble#Historical
- pklausler 11y agoIt's faster to just see 0xf3 and then compute 256 - 13.