floating point glitch
Batista, Facundo
FBatista at uniFON.com.ar
Thu Sep 23 08:47:19 EDT 2004
[David O'Farrell]
#- Python 2.3.3 (#1, Mar 19 2004, 16:18:33)
#- [GCC 2.95.2 19991024 (release)] on sunos5
#- Type "help", "copyright", "credits" or "license" for more
#- information.
#- >>> a=[66.6, 333, 333, 1, 1234.5]
#- >>> print a.count(333), a.count(66.6), a.count('x')
#- 2 1 0
#- >>> a.append(333)
#- >>> print a
#- [66.599999999999994, 333, 333, 1, 1234.5, 333]
FAQ:
http://www.python.org/doc/faq/general.html#why-are-floating-point-calculatio
ns-so-inaccurate
Tutorial: http://www.python.org/dev/doc/devel/tut/node16.html
Decimal: http://www.python.org/dev/doc/devel/whatsnew/node8.html
. Facundo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20040923/112cd5ef/attachment.html>
More information about the Python-list
mailing list