DAGDA SEARCH | Back to results | Support

Issue 31578: Unexpected Floating Point Division Result - Python tracker

Source: https://bugs.python.org/issue31578

homepage

Issue31578 ➜

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.

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
Supported by The Python Software Foundation,
Powered by Roundup Copyright © 1990-2022, Python Software Foundation
Legal Statements