Greatest common divisor: Difference between revisions

Content added Content deleted
Tag: Manual revert
(Improved example moved to main page)
Line 1,545: Line 1,545:
return gcdp( abs(a), abs(b) )
return gcdp( abs(a), abs(b) )
end function</syntaxhighlight>
end function</syntaxhighlight>

==={{header|FutureBasic}}===
<syntaxhighlight lang="futurebasic">window 1, @"Greatest Common Divisor", (0,0,480,270)

local fn gcd( a as short, b as short ) as short
short result
if ( b != 0 )
result = fn gcd( b, a mod b)
else
result = abs(a)
end if
end fn = result

print fn gcd( 6, 9 )

HandleEvents</syntaxhighlight>


==={{header|GFA Basic}}===
==={{header|GFA Basic}}===