2.6.1 - simple division

Mohammad Tayseer m_tayseer82 at yahoo.com
Mon Mar 9 12:27:40 EDT 2009


>>> j = .8
>>> j
0.80000000000000004

Python follows the IEEE-754 standard, which doesn't represent the numbers exactly. See http://en.wikipedia.org/wiki/IEEE_754
 Mohammad Tayseer
http://spellcoder.com/blogs/tayseer





________________________________
From: "farsight at gmail.com" <farsight at gmail.com>
Sent: Sunday, March 8, 2009 4:16:53 PM
Subject: 2.6.1 - simple division

>>> 4 / 5.0
0.800000000000000004
>>> 0.8 * 5
4.0

python 2.6.1 on mac. What the hell is going on here?
--
http://mail.python.org/mailman/listinfo/python-list



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090309/8bc9af1e/attachment-0001.html>


More information about the Python-list mailing list