[New-bugs-announce] [issue32543] odd floor division behavior

Nathan Goldbaum report at bugs.python.org
Fri Jan 12 17:32:48 EST 2018

New submission from Nathan Goldbaum <nathan12343 at gmail.com>:

According to PEP 238:

"floor division will be implemented in all the Python numeric types, and will have the semantics of:

a // b == floor(a/b)

except that the result type will be the common type into which a and b are coerced before the operation."

But consider the following cases in Python 3.6.3:

>>> 0.9//0.1
>>> 0.8//0.1
>>> import math
>>> math.floor(0.9/0.1)
>>> math.floor(0.8/0.1)

Am I missing something?

components: Interpreter Core
messages: 309873
nosy: Nathan.Goldbaum
priority: normal
severity: normal
status: open
title: odd floor division behavior
type: behavior
versions: Python 3.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list