[Idle-dev] Bug Report on float number calculation in IDLE

Grey grey at cqu.edu.cn
Sat Dec 19 05:39:49 EST 2015


Hi there:

     I have found a strange issue on float number calculation in IDEL of Python 2.7X。

     1,When I tried to calculate the sum of a bunch of float numbers in IDLE of Python 2.7.6 I found that the result was not accurate(well, I have knew that it is up to the storage format of data by searching the information on Internet). However, when I try to use print statement to print the result it gave me the right answer. That means the calculation in IDLE may be not the same with that in print statement for a script.The records can be found in attachment named P1_2.7.6.JPG and T1_2.7.6.

     2,I tried to update my Python to 2.7.11, the result is same as that in Python 2.7.6. The records can be found in attachment name P2_XXX and T2_XXX。

     3, Once again, I tried Python 3.5.1. The result is the same, but both of them was not accurate. I know the reason may be the same as I wrote in description 1. The good news is that the result keeps the same with each other.

     In summary of all above, I think that the calculation of float numbers in IDLE of Python 2.7X is not the same with the result of that in Print statement or that in a script.

     Thanks and regards!

     Grey from China, a beginner of Python.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/idle-dev/attachments/20151219/56e48ea6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: P1_2.7.6.JPG
Type: image/jpeg
Size: 37772 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/idle-dev/attachments/20151219/56e48ea6/attachment-0003.jpe>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: P2_2.7.11.JPG
Type: image/jpeg
Size: 33675 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/idle-dev/attachments/20151219/56e48ea6/attachment-0004.jpe>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: P3_3.5.1.JPG
Type: image/jpeg
Size: 31760 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/idle-dev/attachments/20151219/56e48ea6/attachment-0005.jpe>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: T1_2.7.6.txt
URL: <http://mail.python.org/pipermail/idle-dev/attachments/20151219/56e48ea6/attachment-0003.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: T2_2.7.11.txt
URL: <http://mail.python.org/pipermail/idle-dev/attachments/20151219/56e48ea6/attachment-0004.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: T3_3.5.1.txt
URL: <http://mail.python.org/pipermail/idle-dev/attachments/20151219/56e48ea6/attachment-0005.txt>


More information about the IDLE-dev mailing list