flint_mpn_divapprox_fraction
#include <flint/mpn_extras.h>void flint_mpn_divapprox_fraction(mp_ptr q, mp_srcptr a, mp_size_t an, mp_srcptr b, mp_size_t bn, mp_size_t f)sourceSets (q, \mathit{an} - \mathit{bn} + 1 + f) to \lfloor a B^f / b \rfloor or \lfloor a B^f / b \rfloor + 1, the approximate quotient with f fraction limbs. A negative f (with \mathit{an} - \mathit{bn} + 1 + f \ge 1) gives the top limbs of the quotient.
The algorithm is that of flint_mpn_divapprox on the zero padded numerator, so that short divisors with many fraction limbs cost O(qn \cdot \mathit{bn}); the padded numerator is only formed for the register-based, schoolbook, blockwise and divide and conquer algorithms, not for the short and Newton divisions.
The FLINT team, “flint_mpn_divapprox_fraction (mpn_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mpn_extras/flint_mpn_divapprox_fraction.html (generated 2026-10-20).
@misc{flint-doc-mpn-extras-flint-mpn-divapprox-fraction,
author = {{The FLINT team}},
title = {{flint\_mpn\_divapprox\_fraction (mpn\_extras.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/mpn_extras/flint_mpn_divapprox_fraction.html},
note = {Generated 2026-10-20}
}