Dict handling of floats

Jim Richardson warlock at eskimo.com
Fri Apr 25 04:14:01 CEST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have come across a weirdness. I have a number of floats, (lat long
pairs) which I stuff into a dict, but when I take them out, my nice %2f4
number, (say, 47.5894) is something long and *almost* right, like
47.589333333333333339. What gives? I am not doing anything special as
far as I can tell, just stuffing the numbers into a dict, and recalling
it later. This is with Python 2.2 on Linux, and no, it's not an original
Pentium :)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+qJnnd90bcYOAWPYRAly3AKCXn4yiCCh+q1J9Pp8/ZR0GlbwYywCeKbZG
O/FWrpY8wXYvjU+OIu62wpc=
=NUpX
-----END PGP SIGNATURE-----

-- 
Jim Richardson         http://www.eskimo.com/~warlock

Linux, because eventually, you grow up enough to be trusted with a fork()




More information about the Python-list mailing list