too long float

J. Peng peng.kyo at gmail.com
Fri Jan 18 00:55:17 EST 2008


hello,

why this happened on my python?

>>> a=3.9
>>> a
3.8999999999999999

I wanted 3.9 but got 3.89................
How to avoid it? thanks.

this is my python version:

>>> sys.version
'2.3.4 (#1, Feb  6 2006, 10:38:46) \n[GCC 3.4.5 20051201 (Red Hat 3.4.5-2)]'



More information about the Python-list mailing list