in reply to Still puzzled by floats
How would you represent that in binary?9/10 + 5/100
No matter how far you take that series it will *never* be exactly 0.95. The binary representation of 0.95 takes an infinite number of bits.1/2 + 1/4 + 1/8 + 1/16 + 0/32 + 0/64 + 1/128 + 1/256 + 0/512 + 0/1024 + 1/2048 + 1/4096 ...
0.95(10) ≈ 0.1111 0011 0011 0011 0011 0011 0011(2)
But those last four bits repeat forever. Its exactly like writing 1/3 in base 10:
1/3 ≈ 0.33333333333333333333333333333333(10)
-Blake
|
|---|