# XGCD --- greatest common divisor # # xgcd(a,b) = greatest common divisor of a and b # # assume that a and b are positive integers # xgcd := proc(b,a) local r; r := b mod a; # print(b,a,r); if r = 0 then RETURN(a); else xgcd(a,r); fi; end: # jac, 6/11/2001