n_div_precomp_init, n_div_precomp_init_preinv
Synopsis
#include <flint/ulong_extras.h>void n_div_precomp_init(n_div_precomp_t pre, ulong d)sourcevoid n_div_precomp_init_preinv(n_div_precomp_t pre, ulong d, ulong dinv)sourceCompute the data for division by . The second one takes dinv = n_preinvert_limb(d) and needs no division, since for not a power of two is the constant (dinv >> 1) | (UWORD(1) << (FLINT_BITS - 1)) of NMOD_RED (Barrett reduction with an nmod_t). The first one uses a two-word division where n_preinvert_limb does (FLINT_PREINVERT_LIMB_USE_NATIVE: a fast hardware divider), and otherwise calls the second one with n_preinvert_limb(d).
Cite this page
The FLINT team, “n_div_precomp_init, n_div_precomp_init_preinv (ulong_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ulong_extras/n_div_precomp_init.html (generated 2026-11-20).
@misc{flint-doc-ulong-extras-n-div-precomp-init,
author = {{The FLINT team}},
title = {{n\_div\_precomp\_init, n\_div\_precomp\_init\_preinv (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_div_precomp_init.html},
note = {Generated 2026-11-20}
}