Merge branch 'master' of git.osdn.net:/gitroot/joypy/Thun

This commit is contained in:
Simon Forman 2021-11-22 10:29:53 -08:00
commit 9ede53f780
1 changed files with 13 additions and 0 deletions

View File

@ -436,6 +436,19 @@ def take(stack):
return x, stack
@inscribe
@FunctionWrapper
def gcd2(stack, expression, dictionary):
'''Compiled GCD function.'''
(v1, (v2, stack)) = stack
tos = True
while tos:
v3 = v2 % v1
tos = v3 > 0
(v1, (v2, stack)) = (v3, (v1, stack))
return (v2, stack), expression, dictionary
@inscribe
@SimpleFunctionWrapper
def choice(stack):