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: Unexpected Floating Point Division Result
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: r.david.murray, wesinator
Priority: normal Keywords:

Created on 2017-09-25 18:55 by wesinator, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg302966 - (view) Author: wesinator (wesinator) * Date: 2017-09-25 18:55
To reproduce:
>>> 480/1000/13.0
Actual result: 0.0

Expected result: 0.03692307692307692
Adding the zero decimal to any other combinations of the numbers produces the expected floating point result.

Working as expected in Python 3
msg302968 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2017-09-25 18:59
In the absence of the appropriate __future__ import, the python2 division operator uses integer division.
History
Date User Action Args
2022-04-11 14:58:52adminsetgithub: 75759
2017-09-25 18:59:11r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg302968

resolution: not a bug
stage: resolved
2017-09-25 18:55:37wesinatorcreate