FLINT3.7.0-dev

flint_mpn_gcd

Synopsis#include <flint/mpn_extras.h>
mp_size_t flint_mpn_gcd(mp_ptr gp, mp_srcptr ap, mp_size_t an, mp_srcptr bp, mp_size_t bn)source

Sets (gp,ℓ)(\mathit{gp}, \ell) to the greatest common divisor of (ap,an)(\mathit{ap}, \mathit{an}) and (bp,bn)(\mathit{bp}, \mathit{bn}) and returns its length ℓ\ell. The operands must be nonzero with nonzero top limbs (an,bn≥1\mathit{an}, \mathit{bn} \ge 1); they are not modified. gp needs room for min⁡(an,bn)\min(\mathit{an}, \mathit{bn}) limbs; it may be equal to ap or bp but must not otherwise overlap them.

Cite this page

The FLINT team, “flint_mpn_gcd (mpn_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mpn_extras/flint_mpn_gcd.html (generated 2026-11-02).