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: Hw, r.david.murray
Priority: normal Keywords:

Created on 2017-09-25 18:55 by Hw, last changed 2017-09-25 18:59 by r.david.murray. This issue is now closed.

Messages (2)
msg302966 - (view) Author: hw (Hw) * 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
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:37Hwcreate