up previous next
gcd    --    greatest common divisor


Syntax
gcd(M: INT, N: INT): INT
gcd(L: LIST of INT): INT

gcd(F: RINGELEM, G: RINGELEM): RINGELEM
gcd(L: LIST of RINGELEM): RINGELEM

Description
This function returns the greatest common divisor of its arguments or of the elements in the list L. For the calculation of the GCDs and LCMs of polynomials, the coefficient ring must be a field.

Example
/**/  use R ::= QQ[x,y];
/**/  F := x^2-y^2;
/**/  G := (x+y)^3;
/**/  gcd(F, G);
x +y

/**/  gcd([3*4,3*8,6*16]);
12

See Also