this post was submitted on 31 Oct 2023
832 points (96.3% liked)
Programmer Humor
32410 readers
358 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Explanation:
In decimal (DEC), we count to 9 before adding a new digit. For example, the number after 9 is 10, and the number after 19 is 20.
In octal (OCT), we count to 7 before adding a new digit. The number after 7 is 10 and the number after 17 is 20.
TLDR: In octal system, the weight of the digit in a position is an exponent of 8. So 31 = (3×8¹ + 1×8⁰) = (3×8 + 1×1) = 24 + 1 = 25.
It's the same for every base, including base 10.