_fmpz_mod_poly_gcd, fmpz_mod_poly_gcd
Synopsis
#include <flint/fmpz_mod_poly.h>slong _fmpz_mod_poly_gcd(fmpz * G, const fmpz * A, slong lenA, const fmpz * B, slong lenB, const fmpz_mod_ctx_t ctx)sourcevoid fmpz_mod_poly_gcd(fmpz_mod_poly_t G, const fmpz_mod_poly_t A, const fmpz_mod_poly_t B, const fmpz_mod_ctx_t ctx)sourceSet to the greatest common divisor of and , which is made monic by the non-underscore version (the gcd of two zero polynomials is zero). The underscore version requires and space for coefficients in , returns the length of and does not normalise its leading coefficient. The modulus must be prime.
For the Euclidean algorithm is used (_gr_poly_gcd_euclidean), and above that the half-GCD algorithm (_gr_poly_gcd_hgcd with base case cutoff 128), in operations; see Half-GCD.
Guides#
Cite this page
The FLINT team, “_fmpz_mod_poly_gcd, fmpz_mod_poly_gcd (fmpz_mod_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpz_mod_poly/_fmpz_mod_poly_gcd.html (generated 2026-11-02).
@misc{flint-doc-fmpz-mod-poly-fmpz-mod-poly-gcd,
author = {{The FLINT team}},
title = {{\_fmpz\_mod\_poly\_gcd, fmpz\_mod\_poly\_gcd (fmpz\_mod\_poly.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fmpz_mod_poly/_fmpz_mod_poly_gcd.html},
note = {Generated 2026-11-02}
}