[Python-Dev] Round Bug in Python 1.6?

Tim Peters tim_one@email.msn.com
Sun, 9 Apr 2000 16:25:19 -0400


[Christian]
> Hmm, I hope I understood.
> Oh, wait a minute! What is the method? What is the correct value?
>
> If I type
> >>> 0.1
> 0.10000000000000001
> >>> 0.10000000000000001
> 0.10000000000000001
> >>>
>
> There is only one value: The one which is in the machine.
> Would you think it is ok to get 0.1 back, when you
> actually *typed* 0.10000000000000001 ?

Yes, this is the kind of surprise I sketched with the "2-bit machine"
example.  It can get more surprising than the above (where, as you suspect,
"shortest conversion" yields "0.1" for both -- which, btw, is why reading it
back in to a float type with more precision loses accuracy needlessly, which
in turn is why 754 True Believers dislike it).

repetitively y'rs  - tim