[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
8.0
>>> 0.8//0.1
8.0
>>> import math
>>> math.floor(0.9/0.1)
9
>>> math.floor(0.8/0.1)
8

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>
<https://bugs.python.org/issue32543>
_______________________________________


More information about the Python-bugs-list mailing list