Make divmod work like the docs say it does.

This commit is contained in:
Simon Forman 2022-03-25 10:56:15 -07:00
parent a2541e644b
commit 79fbe15f51
1 changed files with 3 additions and 3 deletions

View File

@ -582,9 +582,9 @@ def divmod_(S):
Return the tuple (x//y, x%y). Invariant: q * y + r == x.
'''
a, (b, stack) = S
d, m = divmod(a, b)
return d, (m, stack)
y, (x, stack) = S
q, r = divmod(x, y)
return r, (q, stack)
def sqrt(a):