Welcome to the iTechForums.
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below. To register now click here.
Divide both numerator and denominator by the GCD. GCD is coded as a recursive function:
function GCD(x,y:integer):integer;
begin
if x=0 then GCD:=y
else if x>y then GCD:=GCD(x,y)
else GCD:=GCD(y mod x,x);
end;