Simple calculation error

Francois Liot fliot at kyriba.com
Fri Jan 4 18:48:57 CET 2008


Dear all,

 

I observed a strange calculation answer, on both python 2.3.4 and 2.4.4

 

>>> print 753343.44 - 753361.89

-18.4500000001

>>> print ( (753361.89*100) - (753343.44*100) ) / 100

18.45

 

Can somebody help me to play correctly with decimal values?

 

Thanks in advance,

 

Francois Liot

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080104/f3afd13e/attachment.html>


More information about the Python-list mailing list