HakkerBlog

Home Blog Microposts Recommended Now Contact

Binary is Unintuitive

2025-12-16 — Estimated read time: 2 minutes
Go back

The largest value you can store in one value in base10 is 9, however in base2 (i.e binary) it's only 1. With three values, we can store 999 is base10, but only 7 in base2. By eight values, we can reach 99 999 999 in base10, but only 256 in base2.

Let's try some bigger values. If we made a counter of millisecond precision that stored the count in base2 with 32 values, how far do you reckon it could store? Just a hair under 50 days, not that much, considering we have 32 entire values. What about 64 values, maybe a couple of years perhaps? Oh is that where that 2038 bug occurs perhaps?

Well, no. A millisecond counter with 64 bits could count for 584 million years...

Though, in base 10 with 64 values, we could store 3*10^53 years, so still not that impressive.

To make it slightly more understandable why a doubling of values can take un from tens of days to millions of years, think like this. Imagine for every millisecond there are in 50 days, you'd increment the counter not by one, but by the amount of ms in 50 days (about 5 billion). Now we are starting to reach these stupidly high numbers.

By 128 bits, we are nearing the heat death of the universe...

Thoughts, opinions or simply want to say hello?
Send me a mail, I might even respond!

Written by hand without AI, typos and all