OSDN Git Service
(root)
/
joypy
/
Thun.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a2541e6
)
Make divmod work like the docs say it does.
author
Simon Forman
<sforman@hushmail.com>
Fri, 25 Mar 2022 17:56:15 +0000
(10:56 -0700)
committer
Simon Forman
<sforman@hushmail.com>
Fri, 25 Mar 2022 17:56:15 +0000
(10:56 -0700)
implementations/Python/joy/library.py
patch
|
blob
|
history
diff --git
a/implementations/Python/joy/library.py
b/implementations/Python/joy/library.py
index
c5d17ce
..
5dc02bb
100644
(file)
--- 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):