2 ms·
Computers store numbers in base 2 rather than base 10. That means each digit is no longer the ones/tens/hundreds place, but instead the ones/twos/fours/eights p
by weberer 4y ago
Computers store numbers in base 2 rather than base 10. That means each digit is no longer the ones/tens/hundreds place, but instead the ones/twos/fours/eights place. This is all fine when talking about integers, since every integer in base 10 can be represented in base 2.
The problem is when converting decimals. Now instead of each digit being tenths/hundredths/thousandths, we have halfs/fourths/eights/etc. Now try out the problem yourself. Imagine you had a formula in the form of
(1/2)x + (1/4)y + (1/8)z + (1/16)a + (1/32)b ...
Try to find a solution that adds up to exactly 0.1 and you'll see that it can't be done. Computers just get as close as they can.