This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Float division
Type: behavior Stage:
Components: Interpreter Core Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, cancelliere
Priority: normal Keywords:

Created on 2011-06-14 13:39 by cancelliere, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (4)
msg138311 - (view) Author: Carmine Paolino (cancelliere) Date: 2011-06-14 13:39
Trying to run this simple script:
for i in range(10):
    print(i*0.2)
when i is 3, the result given is 0.6000000000000001.
What could the problem be?
msg138312 - (view) Author: Carmine Paolino (cancelliere) Date: 2011-06-14 13:44
When I try to run 3*0.2 in Python shell or using an IDLE document, the result given is 0.6000000000000001.
msg138313 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2011-06-14 13:46
Yep. See http://docs.python.org/tutorial/floatingpoint.html
msg138344 - (view) Author: Carmine Paolino (cancelliere) Date: 2011-06-14 16:35
Thank you for your help.
History
Date User Action Args
2022-04-11 14:57:18adminsetgithub: 56541
2011-06-14 16:35:52cancellieresetmessages: + msg138344
2011-06-14 13:46:46benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg138313

resolution: not a bug
2011-06-14 13:44:42cancellieresetmessages: + msg138312
2011-06-14 13:39:23cancellierecreate