FLINT3.7.0-dev

_flint_mpn_gcd_inplace

Synopsis#include <flint/mpn_extras.h>
mp_size_t _flint_mpn_gcd_inplace(mp_ptr gp, mp_ptr up, mp_size_t un, mp_ptr vp, mp_size_t vn)source

The GCD with the interface of GMP's mpn_gcd: sets (gp,ℓ)(\mathit{gp}, \ell) to the greatest common divisor of (up,un)(\mathit{up}, \mathit{un}) and (vp,vn)(\mathit{vp}, \mathit{vn}) and returns ℓ\ell. It is required that un≥vn>0\mathit{un} \ge \mathit{vn} > 0, that the top limb of vv is nonzero and that at least one of the operands is odd. Both inputs are destroyed. gp needs room for vn\mathit{vn} limbs; it may be equal to up or vp but must not otherwise overlap them.

Cite this page

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