mp_real_struct, mp_real_t
#include <flint/mp_real.h>mp_real_structmp_real_tA ball
with fields d (the mantissa limbs, least significant first), alloc, size, negative, exp (an slong exponent in limbs) and err (a ulong radius in ulps of the mantissa's last limb). A nonzero mantissa has a nonzero top limb, so that B^{\mathit{exp}-1} \le |\mathrm{mid}| < B^{\mathit{exp}}; size = 0 encodes a zero midpoint, whose radius is counted in units of B^{\mathit{exp}}. An mp_real_t is an array of one mp_real_struct, so that it is passed by reference.
The radius count satisfies 0 \le \mathit{err} < B, and err = 0 means that the ball is exact. The radius has no exponent of its own; instead the mantissa length is adjusted to it:
- a radius below one ulp of the current mantissa is installed by padding the mantissa with zero limbs down to the radius's scale (so balls such as 1 - \varepsilon carry their zero limbs explicitly);
- a radius of B ulps or more truncates the mantissa by as many limbs as needed, the dropped limbs being rounded into one more unit at the new last limb.
The mantissa length therefore tracks the number of accurate limbs, with at most one limb of noise. Exact values carry no low zero limbs, so that small exact integers stay one limb long. See Ball arithmetic with limb-granular radii for the consequences.
Guides#
The FLINT team, “mp_real_struct, mp_real_t (mp_real.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mp_real/mp_real_struct.html (generated 2026-10-20).
@misc{flint-doc-mp-real-mp-real-struct,
author = {{The FLINT team}},
title = {{mp\_real\_struct, mp\_real\_t (mp\_real.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/mp_real/mp_real_struct.html},
note = {Generated 2026-10-20}
}