Message269948
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/expressions.html#binary-arithmetic-operations):
x == (x//y) + (x%y)
or, more clearly,
divmod(x, y) = (x//y, x%y)
math.floor(x/y), on the other hand, is doing the floating point division first, and then taking the floor. Different operations, and thus, given floating point realities, different results are not surprising (at least to me...maybe I'm naive? :)
Is this worth an additional documentation note of some sort? I'm not sure, I'll defer to Mark. |
|
Date |
User |
Action |
Args |
2016-07-07 16:27:54 | r.david.murray | set | recipients:
+ r.david.murray, mark.dickinson, steven.daprano, izaakweiss |
2016-07-07 16:27:54 | r.david.murray | set | messageid: <1467908874.56.0.0840849270295.issue27463@psf.upfronthosting.co.za> |
2016-07-07 16:27:54 | r.david.murray | link | issue27463 messages |
2016-07-07 16:27:54 | r.david.murray | create | |
|