[Tutor] Floating Point Craziness

Válas Péter sulinet at postafiok.hu
Mon Jun 13 15:08:46 CEST 2011


2011/6/12 Brett Ritter <swiftone at swiftone.org>

>
> Okay fine, so "1024" stored as a number only requires 10 bits (binary
> digits) to store,

Actually, 11. :-)

Another point that was still not emphasized enough: that's why Python's
documentation at
http://docs.python.org/dev/library/stdtypes.html#mapping-types-dict says:
"Note however, that since computers store floating-point numbers as
approximations it is usually unwise to use them as dictionary keys."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110613/d3fce827/attachment.html>


More information about the Tutor mailing list