FLINT3.7.0-dev

mp_real_div, mp_real_div_ui

Synopsis#include <flint/mp_real.h>
void mp_real_div(mp_real_t res, const mp_real_t a, const mp_real_t b, slong n)source
void mp_real_div_ui(mp_real_t res, const mp_real_t a, ulong c, slong n)source

Set res to a / b resp. a / c. The divisor ball must have a relative radius below 2^{-30}; mp_real_div throws for a wider or zero divisor, and mp_real_div_ui for c = 0.

A divisor ball with a relative radius of 2^{-30} or more is treated as a usage error, since the quotient's mantissa would be noise; use mp_real_get_arb and arb_div for such balls. mp_real_div_ui divides by mpn_divrem_1 over appended zero limbs, keeping the quotient's own precision (an exact dividend gets a quotient of n + 2 limbs), so that a chain of divisions by a common denominator loses no accuracy relative to the quotients.

Guides#

Cite this page

The FLINT team, “mp_real_div, mp_real_div_ui (mp_real.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mp_real/mp_real_div.html (generated 2026-10-20).