_ca_poly_gcd_euclidean, ca_poly_gcd_euclidean, _ca_poly_gcd, ca_poly_gcd
#include <flint/ca_poly.h>slong _ca_poly_gcd_euclidean(ca_ptr G, ca_srcptr A, slong lenA, ca_srcptr B, slong lenB, ca_ctx_t ctx)sourceSets G to the monic greatest common divisor of A and B (zero if both are zero) and returns 1. Returns 0, leaving G unspecified, if a zero test of a leading coefficient fails during the computation (in particular if the leading coefficient of an input is not proved nonzero).
The underscore versions require \mathit{lenA} \ge \mathit{lenB} \ge 1 and nonzero leading coefficients, write at most \mathit{lenB} coefficients of a GCD that is not necessarily monic, and return its length, or 0 on failure.
The euclidean versions run the Euclidean algorithm, testing each remainder's leading coefficient for zero. The default versions first handle rational polynomials by an integer GCD computation over \mathbb{Z} (_fmpz_poly_gcd), then try to prove numerically that A and B are coprime by evaluating their Sylvester resultant in ball arithmetic at precision CA_OPT_LOW_PREC (a resultant ball excluding zero proves \gcd = 1), and otherwise use the Euclidean algorithm.
Guides#
- Using ca (
ca)
The FLINT team, “_ca_poly_gcd_euclidean, ca_poly_gcd_euclidean, _ca_poly_gcd, ca_poly_gcd (ca_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ca_poly/_ca_poly_gcd_euclidean.html (generated 2026-10-20).
@misc{flint-doc-ca-poly-ca-poly-gcd-euclidean,
author = {{The FLINT team}},
title = {{\_ca\_poly\_gcd\_euclidean, ca\_poly\_gcd\_euclidean, \_ca\_poly\_gcd, ca\_poly\_gcd (ca\_poly.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/ca_poly/_ca_poly_gcd_euclidean.html},
note = {Generated 2026-10-20}
}