by "Tom Lake" <tlake@[EMAIL PROTECTED]
>
Apr 3, 2008 at 11:11 AM
"Geeza" <a@[EMAIL PROTECTED]
> wrote in message
news:zR5Jj.2379$tW.1956@[EMAIL PROTECTED]
> The freebasic site is down currently and i'm looking at calculating a
GCD using
> Freebasic. I did look before, but i couldn't find much documentation on
it.
>
> TIA
Here's a version:
'----------------------------------------------------------------
declare function gcd(x,y)
print gcd(112,144)
sleep
function gcd(x,y)
do
q=int(x/y)
r=x-q*y
x=y
y=r
loop until r<=0
gcd=x
end function
'----------------------------------------------------------------
Example:
print gcd(112,144)
16
Tom Lake