FLINT3.7.0-dev

n_gcdinv

Synopsis#include <flint/ulong_extras.h>
ulong n_gcdinv(ulong * a, ulong x, ulong y)source

Returns g=gcd⁡(x,y)g = \gcd(x, y) and sets *a to the 0≤a<y0 \le a < y with ax≡g(mody)ax \equiv g \pmod y. Requires x<yx < y. When y=1y = 1, returns 1 and sets *a to 0.

Cite this page

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