RosettaCodeData/Task/Greatest-common-divisor/BASIC/greatest-common-divisor-2.basic
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

6 lines
136 B
Text

function gcd(a%, b%)
if a = 0 gcd = b
if b = 0 gcd = a
if a > b gcd = gcd(b, a mod b)
gcd = gcd(a, b mod a)
end function