n_xgcd
Synopsis
#include <flint/ulong_extras.h>n_xgcd uses the extended Euclidean algorithm, which always produces cofactors and , apart from a few degenerate cases. The proof is by induction. Suppose that at some step with and with and . Then , and it suffices to show , since . At the previous step of the back-substitution we had with and , so .
Cite this page
The FLINT team, “n_xgcd (ulong_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ulong_extras/n_xgcd.html (generated 2026-11-02).
@misc{flint-doc-ulong-extras-n-xgcd,
author = {{The FLINT team}},
title = {{n\_xgcd (ulong\_extras.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/ulong_extras/n_xgcd.html},
note = {Generated 2026-11-02}
}