Make divmod work like the docs say it does.
This commit is contained in:
parent
a2541e644b
commit
79fbe15f51
|
|
@ -582,9 +582,9 @@ def divmod_(S):
|
||||||
|
|
||||||
Return the tuple (x//y, x%y). Invariant: q * y + r == x.
|
Return the tuple (x//y, x%y). Invariant: q * y + r == x.
|
||||||
'''
|
'''
|
||||||
a, (b, stack) = S
|
y, (x, stack) = S
|
||||||
d, m = divmod(a, b)
|
q, r = divmod(x, y)
|
||||||
return d, (m, stack)
|
return r, (q, stack)
|
||||||
|
|
||||||
|
|
||||||
def sqrt(a):
|
def sqrt(a):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue