Previous Up Next

5.37.3  GCD in ℤ/pℤ[x]: Gcd

Gcd is the inert form of gcd.
Gcd returns the gcd (greatest common divisor) of two polynomials (or of a list of polynomials or of a sequence of polynomials) without evaluation.
It is used in conjunction with mod in Maple syntax mode to compute the gcd of two polynomials with coefficients in ℤ/pℤ with p prime (see also 5.30.7).
Input in Xcas mode:

Gcd((2*x^2+5,5*x^2+2*x-3)%13)

Output:

gcd((2*x^2+5)%13,(5*x^2+2*x-3)%13)

you need to eval(ans()) to get:

(1%13)*x+2%13

Input in Maple mode:

Gcd(2*x^2+5,5*x^2+2*x-3) mod 13

Output:

1*x+2

Input:

Gcd(x^2+2*x,x^2+6*x+5) mod 5

Output:

1*x

Previous Up Next