function GCD(a,b){
if (a>b) return GCD(a-b,b);
else
if (b>a) return GCD(a,b-a);
else
return a;
}
//Non recursive function
function GCD_fast(a,b){
while ( a!=b )
{
if (a>b) a = a-b;
else
if (b>a) b = b-a;
}
return a;
}
function GCD(a,b){
if (a>b) return GCD(a-b,b);
else
if (b>a) return GCD(a,b-a);
else
return a;
}
//Non recursive function
function GCD_fast(a,b){
while ( a!=b )
{
if (a>b) a = a-b;
else
if (b>a) b = b-a;
}
return a;
}