When is divmod(a,b) == floor(a/b)-1 ?
no.email at please.post
Thu Sep 24 21:40:37 CEST 2009
The docs for divmod include the following:
...For floating point numbers the result is (q, a % b), where q
is usually math.floor(a / b) but may be 1 less than that. ...
I know that floating point math can sometimes produce "unexpected"
results, so the above caveat is not entirely surprising. Still,
I would find it helpful to see a specific example where
divmod(a, b) is equal to math.floor(a/b)-1. Does anybody know
More information about the Python-list