Why the nonsense number appears?

Daniel Dittmar daniel.dittmar at sap.corp
Mon Oct 31 04:36:23 EST 2005


Johnny Lee wrote:
>>>>print time1, time2
> 
> 1130748744.461 1130748744.500
> 
>>>>float(time2) - float(time1)
> 
> 0.039000034332275391
> 
> 
>    Why are there so many nonsense tails? thanks for your help.

http://en.wikipedia.org/wiki/Floating_point#Problems_with_floating-point, 
especially 'Rounding'. Or google for "gloating point precision" if you 
need more details.

Daniel



More information about the Python-list mailing list