
gcd - greatest common divisor of polynomials

Calling sequence:

gcd(poly ...)
gcd(expr ...)

Parameter:
poly   --  polynomial
expr   --  expression

Overloading:

all

Summary:

gcd calculates the greatest common divisor of any number of polynomials.
The polynomials may either have the rationals, a residue class ring IntMod(p)
with a prime number p or a domain as their coefficient ring.

If the arguments are polynomials with coefficients from a domain  then the
domain must have the methods gcd and divex ("divide exact\). The method
gcd must return the greatest common divisor for any number of domain
elements. The method divex must divide an domain element by another; if
the domain elements cannot be divided then the method must return FAIL.

The arguments of gcd may be either polynomials or expressions. Expressions
are converted into polynomials (see function poly). gcd returns FAIL if an
expression cannot be converted.

>>  gcd(6*x^3 + 9*x^2*y^2, 2*x + 2*x*y + 3*y^2 + 3*y^3);

      2*x + 3*y^2

>>  a:= poly(2*x^2  - 4*x*y - 2*x + 4*y, [x,y], IntMod(17)):
    b:= poly(x^2*y  - 2*x*y^2, [x,y], IntMod(17)):
    gcd(a, b);

      poly(x - 2*y, [x,y], IntMod(17))

See also:  content , igcd, lcm, poly

