n_mod2_precomp
Synopsis
#include <flint/ulong_extras.h>For n < 2^{53} and a < n^2, n_mod2_precomp computes the quotient as n_mod_precomp does. Otherwise the top 52 bits of the quotient are correct; the remainder is then multiplied by ninv again to obtain a correction, which may be one out in either direction and is fixed up at the end.
Cite this page
The FLINT team, “n_mod2_precomp (ulong_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ulong_extras/n_mod2_precomp.html (generated 2026-10-20).
@misc{flint-doc-ulong-extras-n-mod2-precomp,
author = {{The FLINT team}},
title = {{n\_mod2\_precomp (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_mod2_precomp.html},
note = {Generated 2026-10-20}
}