udiv_qrnnd_preinv
Synopsis
#include <flint/longlong.h>udiv_qrnnd_preinv(q, r, n1, n0, d, dinv)sourceAs udiv_qrnnd, but faster: uses the precomputed inverse dinv = n_preinvert_limb_prenorm(d) instead of a hardware division. The divisor must be normalised (its top bit set) and . This is Algorithm 4 of Möller and Granlund (Division by an invariant word): one full and one low product, and a final correction that is rarely needed. The inputs are read before q and r are written, so q and r may be variables that are also inputs.
Guides#
Cite this page
The FLINT team, “udiv_qrnnd_preinv (longlong.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/longlong/udiv_qrnnd_preinv.html (generated 2026-11-20).
@misc{flint-doc-longlong-udiv-qrnnd-preinv,
author = {{The FLINT team}},
title = {{udiv\_qrnnd\_preinv (longlong.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/longlong/udiv_qrnnd_preinv.html},
note = {Generated 2026-11-20}
}