[issue42788] Issue with Python’s Floor Division

2020-12-30 Thread Eric V. Smith
Eric V. Smith added the comment: Oops, my message collided with rhettinger. -- nosy: +rhettinger ___ Python tracker ___ ___ Python-

[issue42788] Issue with Python’s Floor Division

2020-12-30 Thread Eric V. Smith
Eric V. Smith added the comment: Regular division (/) yields a float, so 1 / 1 is 1.0. https://docs.python.org/3/reference/expressions.html#binary-arithmetic-operations says that for floor division, the arguments are first converted to a common type, which here would be float. So, your exam

[issue42788] Issue with Python’s Floor Division

2020-12-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: The current behavior was specified in PEP 238: int / int -> float float // int -> float See: https://www.python.org/dev/peps/pep-0238/#semantics-of-floor-division -- nosy: +rhettinger resolution: -> not a bug stage: -> resolv

[issue42788] Issue with Python’s Floor Division

2020-12-30 Thread yao_way
New submission from yao_way : There might be an issue with Python’s floor division: Experienced Behavior: >>> (1 / 1) // 1 --> 1.0; >>> (0 / 1) // 1 --> 0.0 Expected Behavior: >>> (1 / 1) // 1 --> 1; >>> (0 / 1) // 1 --> 0 -- components: Interpreter Core messages: 384073 nosy: yao_way pr