FLINT3.7.0-dev

n_div_precomp, n_div_precomp_bounded, n_div_precomp_m0, n_div_precomp_c0, n_div_precomp_c1, n_div_precomp_c1_bounded

Synopsis#include <flint/radix.h>
ulong n_div_precomp(ulong x, const n_div_precomp_t pre)source
ulong n_div_precomp_bounded(ulong x, const n_div_precomp_t pre)source
ulong n_div_precomp_m0(ulong x, const n_div_precomp_t pre)source
ulong n_div_precomp_c0(ulong x, const n_div_precomp_t pre)source
ulong n_div_precomp_c1(ulong x, const n_div_precomp_t pre)source
ulong n_div_precomp_c1_bounded(ulong x, const n_div_precomp_t pre)source

Return ⌊x/d⌋\lfloor x/d \rfloor for any word xx: n_div_precomp selects the method from pre, and the other functions are the individual methods for callers that know the case: x≫ℓx \gg \ell for a power of two (m=0m = 0), ⌊xm/2FLINT_BITS⌋≫ℓ\lfloor xm / 2^{\mathtt{FLINT\_BITS}} \rfloor \gg \ell for c=0c = 0, and ⌊(x+1)m/2FLINT_BITS⌋≫ℓ\lfloor (x + 1) m / 2^{\mathtt{FLINT\_BITS}} \rfloor \gg \ell for c=1c = 1, where x+1x + 1 saturates at β−1\beta - 1. The bounded versions require x≠β−1x \ne \beta - 1 and skip the saturation.

Cite this page

The FLINT team, “n_div_precomp, n_div_precomp_bounded, n_div_precomp_m0, n_div_precomp_c0, n_div_precomp_c1, n_div_precomp_c1_bounded (radix.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/radix/n_div_precomp.html (generated 2026-11-02).