Works for integers, rationals and polynomials in any number of variables
(heuristic GCD with a primitive PRS fallback, as in SymPy). The result is
normalized to a positive leading coefficient with integer content.
gcd_list() and lcm_list() take a list. gcdex() returns s, t and
h with s*f + t*g = h for univariate polynomials; invert() computes
the inverse of f modulo g.
Usage
gcd(f, g, ...)
gcd_list(seq, ...)
lcm_list(seq, ...)
gcdex(f, g, ...)
invert(f, g, ...)
sym_lcm(f, g, ...)Arguments
- f, g
Expressions or
Poly()objects.- ...
Generators.
- seq
A list of expressions.