mp_real_set_dfloat, mp_real_get_dfloat
#include <flint/mp_real.h>Convert from and to the double expansions of dfloat: arrays of n \le 8 doubles (the midpoint components) and a double radius. mp_real_set_dfloat sets res to the ball \sum_i x_i \pm \mathit{rad} and throws for nonfinite components or radius. mp_real_get_dfloat rounds x greedily to n doubles and sets rad (if not NULL) to a bound for the error and the radius of x.
The sum in mp_real_set_dfloat is exact, accumulated in a two's complement frame spanning the components' exponents, and the radius is installed as an ulp count, rounded up. In mp_real_get_dfloat each component is the double nearest to the remainder, so that |x_{i+1}| \le \operatorname{ulp}(x_i)/2; components that would be subnormal are not produced (their value goes to the radius), and a value beyond the double range gives dfloat's whole line, zero components with an infinite radius. Both conversions avoid arb_t.
The FLINT team, “mp_real_set_dfloat, mp_real_get_dfloat (mp_real.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mp_real/mp_real_set_dfloat.html (generated 2026-10-20).
@misc{flint-doc-mp-real-mp-real-set-dfloat,
author = {{The FLINT team}},
title = {{mp\_real\_set\_dfloat, mp\_real\_get\_dfloat (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_set_dfloat.html},
note = {Generated 2026-10-20}
}