[New-bugs-announce] [issue39703] Floor division operator and floats
report at bugs.python.org
Thu Feb 20 11:25:56 EST 2020
New submission from Kostis Gourgoulias <kgourgoulias at gmail.com>:
This was brought to my attention by a colleague, Albert B.
When considering the floor division // operator, 1//0.01 should return 100.0, but instead returns 99.0. My understanding is that this is because 0.01 is represented by
which is greater than 0.01.
math.floor(1/0.01) correctly outputs 100. Shouldn't the two approaches provide the same answer?
nosy: Kostis Gourgoulias, ned.deily, ronaldoussoren
title: Floor division operator and floats
versions: Python 3.7
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce