FLINT3.7.0-dev

flint_mpn_gcd_vec

Synopsis#include <flint/mpn_extras.h>
mp_size_t flint_mpn_gcd_vec(mp_ptr g, mp_size_t gn, const mp_srcptr * xp, const mp_size_t * xn, slong len)source

Sets (g,ℓ)(g, \ell) to the greatest common divisor of (g,gn)(g, \mathit{gn}) and the len values (xpi,xni)(\mathit{xp}_i, \mathit{xn}_i), and returns its length ℓ\ell (0 if all are zero). The values are given by pointer, so that they need not be contiguous or copied, and must be normalised (top limb nonzero), with xni=0\mathit{xn}_i = 0 for zero; gn=0\mathit{gn} = 0 means that gg is not used as input. The inputs are not modified. The output array gg must have room for min⁡(gn,xni)\min(\mathit{gn}, \mathit{xn}_i) limbs, the minimum taken over the nonzero inputs, and must not overlap the values.

Cite this page

The FLINT team, “flint_mpn_gcd_vec (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_vec.html (generated 2026-11-02).