FLINT3.7.0-dev

radix_div_exp, radix_divrem_exp

Synopsis#include <flint/radix.h>
ulong radix_div_exp(ulong x, const radix_t radix)source
ulong radix_divrem_exp(ulong * r, ulong x, const radix_t radix)source

Return ⌊x/e⌋\lfloor x / e \rfloor (and set r=x mod er = x \bmod e), converting a number of digits to a number of limbs without a hardware division. For e>2e > 2 this is one multiplication by a precomputed ⌈2FLINT_BITS−2+ℓ/e⌉\lceil 2^{\mathtt{FLINT\_BITS} - 2 + \ell} / e \rceil, ℓ=⌈log⁡2e⌉\ell = \lceil \log_2 e \rceil, and a shift, exact for x<2FLINT_BITS−2x < 2^{\mathtt{FLINT\_BITS} - 2}; larger xx use n_div_precomp.

Cite this page

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