arb_can_round_arf, arb_can_round_mpfr
#include <flint/arb.h>If the function returns nonzero, arf_set_round, arf_get_mpfr (with an output variable of precision prec) or arf_get_d (with prec = 53) applied to the midpoint give a correctly rounded result, and arf_get_mpfr also returns the correct MPFR ternary value. This is how a correctly rounded function can be built on ball arithmetic: evaluate with a few guard bits, and repeat at higher precision while this test fails. The test is fast and conservative: it may return 0 when rounding is in fact possible. It returns 0 for non-finite x, even an exact infinity. The two versions differ only in the type of the rounding mode.
Guides#
The FLINT team, “arb_can_round_arf, arb_can_round_mpfr (arb.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/arb/arb_can_round_arf.html (generated 2026-10-20).
@misc{flint-doc-arb-arb-can-round-arf,
author = {{The FLINT team}},
title = {{arb\_can\_round\_arf, arb\_can\_round\_mpfr (arb.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/arb/arb_can_round_arf.html},
note = {Generated 2026-10-20}
}