[issue27463] Floor division is not the same as the floor of division

2016-07-07 Thread R. David Murray
R. David Murray added the comment: That's good enough for me. Closing. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue27463] Floor division is not the same as the floor of division

2016-07-07 Thread Tim Peters
Tim Peters added the comment: Note that the same is true in Python 2. I don't want to document it, though. In `math.floor(44/4.4)`, the subexpression `44/4.4` by itself wholly rules out that "[as if] with infinite precision [throughout the larger expression]" may be in play. `44/4.4` rounds

[issue27463] Floor division is not the same as the floor of division

2016-07-07 Thread R. David Murray
R. David Murray added the comment: I see Steven beat me to posting, but I'll post this anyway since it addresses the existing documentation. Those are already documented as being two different operations. // is "floor" in the sense (as documented in https://docs.python.org/3/reference/expres

[issue27463] Floor division is not the same as the floor of division

2016-07-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: The behaviour of both are correct: the binary float nearest to 4.4 is just a smidgen *bigger* than the exact decimal 4.4, so 44//4.4 truncates to 9.0. But floor(44/4.4) evaluates 44/4.4 first, and that rounds rather than truncating, giving 10.0, which then fl

[issue27463] Floor division is not the same as the floor of division

2016-07-07 Thread Izaak Weiss
New submission from Izaak Weiss: The floor division operator in Python 3 `x//y` acts differently than the floor of the division operator `math.floor(x/y)` in some edge cases due to floating point errors. Consider `44//4.4` and `math.floor(44/4.4)`. These two expressions should, with infinite