S
Skip Montanaro
I understand why the repr() of float("95.895") is "95.894999999999996".
What I don't understand is why if I multiply the best approximation to
95.895 that the machine has by 10000 I magically seem to get the lost
precision back. To wit:
% python
Python 2.3.4 (#12, Jul 2 2004, 09:48:10)
[GCC 3.3.2] on sunos5
Type "help", "copyright", "credits" or "license" for more information. 958950.0
Why isn't the last result "958949.99999999996"? IOW, how'd I get back the
lost bits?
Thx,
Skip
What I don't understand is why if I multiply the best approximation to
95.895 that the machine has by 10000 I magically seem to get the lost
precision back. To wit:
% python
Python 2.3.4 (#12, Jul 2 2004, 09:48:10)
[GCC 3.3.2] on sunos5
Type "help", "copyright", "credits" or "license" for more information. 958950.0
Why isn't the last result "958949.99999999996"? IOW, how'd I get back the
lost bits?
Thx,
Skip