Dict handling of floats

Adam Hupp hupp at cs.wisc.edu
Thu Apr 24 23:19:25 EDT 2003


On Thu, Apr 24, 2003 at 07:14:01PM -0700, Jim Richardson wrote:
> 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 :)

http://www.python.org/doc/current/tut/node14.html

-Adam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030424/9c1c19eb/attachment.sig>


More information about the Python-list mailing list