I need floor division for the remaining computation, so that part I'm happy with.(Actually, when I start to use divmod I have only non-negative numbers)
the bug hunting was: Why is the window asymmetric?
What threw me off is the operator precedence, what Robert said about operator precedence is kind of obvious ex-post, but the case where it matters doesn't show up often enough to automatically think about it, and the familiar float analogy doesn't apply.
e.g. I avoid remembering some rules by using explicit, defensive parenthesis