Why is 2.3 = 2.2999999999999998 ?

Jp Calderone exarkun at intarweb.us
Thu Jan 23 18:56:26 EST 2003


On Fri, Jan 24, 2003 at 12:11:47AM +0100, Arne Koewing wrote:
> my puthon installation seems to ce confused about floats...

  Certain numbers are not exactly representable in base two (short of using
an infinite amount of memory).  Compare this to the decimal representation
of one third.   0.333...   This is a common problem, associated with
floating points in pretty much every programming language (for binary
computers).

  Jp

-- 
"One World, one Web, one Program." - Microsoft(R) promotional ad
"Ein Volk, ein Reich, ein Fuhrer." - Adolf Hitler
-- 
 up 39 days, 3:48, 1 user, load average: 1.68, 1.62, 1.64
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030123/64ca6544/attachment.sig>


More information about the Python-list mailing list