RosettaCodeData/Task/Greatest-common-divisor/MiniScript/greatest-common-divisor.mini

11 lines
148 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
gcd = function(a, b)
while b
temp = b
b = a % b
a = temp
end while
return abs(a)
end function
print gcd(18,12)