Computers speak a different language than humans. We count in base ten because we have ten fingers. Computers use base two, or binary, which only has zeros and ones. This works great for whole numbers like one, two, or three. But fractions get tricky! When you ask a computer to add 0.1 and 0.2, it tries to convert those decimals into long strings of binary digits. The problem is that some decimal fractions cannot be written perfectly in binary, just like one third (1/3) becomes 0.3333... forever in our system. Because the computer has a limited amount of space for these numbers, it has to chop off the extra bits at the end. This leaves a tiny leftover piece called an epsilon. So while we see 0.3 on our screens, the computer actually sees something like 0.30000000000000004 because of those chopped-off digits!
Examples
- When you buy a $0.10 item with a $0.20 coupon, your receipt might show a tiny leftover change due to computer math.
- Calculators use binary code internally, which makes small fractions like one-tenth slightly 'wobbly' compared to whole numbers.
- If you add 0.1 and 0.2 in Excel, you can see the extra digits if you click on that specific cell.
Ask a question
See also
- Why Are Some Numbers 'Favourite' to Computers?
- How Computers Perform Mathematical Calculations | Using adders, binary and logic gates.?
- How Does Binary Explained in 01100100 Seconds Work?
- How Does a Computer (Physically) Read Code?
- What is 0s and 1s?