From 79fbe15f5108bbcc320060fc9bca2887f9aa520e Mon Sep 17 00:00:00 2001 From: Simon Forman Date: Fri, 25 Mar 2022 10:56:15 -0700 Subject: [PATCH] Make divmod work like the docs say it does. --- implementations/Python/joy/library.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/implementations/Python/joy/library.py b/implementations/Python/joy/library.py index c5d17ce..5dc02bb 100644 --- a/implementations/Python/joy/library.py +++ b/implementations/Python/joy/library.py @@ -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): -- 2.11.0