FLINT3.7.0-dev

_decfloat_set_round_arb_err, _decfloat_round_arb, _decfloat_round_arb_small, _decfloat_round_ball, _decimal_arb_10_pow_fmpz, _decimal_digits_to_bits

Synopsis#include <flint/decimal.h>
int _decfloat_set_round_arb_err(decfloat_t res, decmag_ptr err, const arb_t x, slong prec, int rnd, gr_ctx_t ctx)source
int _decfloat_round_arb(decfloat_t res, const arb_t x, slong prec, int rnd, gr_ctx_t ctx)source
int _decfloat_round_arb_small(decfloat_t res, const arf_t mid, const mag_t rad, slong prec, int rnd, gr_ctx_t ctx)source
int _decfloat_round_ball(decfloat_t res, const decball_t Y, slong prec, int rnd, gr_ctx_t bctx, gr_ctx_t ctx)source
void _decimal_arb_10_pow_fmpz(arb_t res, const fmpz_t t, slong wp)source
slong _decimal_digits_to_bits(slong prec)source

The steps of Ziv's strategy: round an arb ball (or a decball Y of the context bctx) to prec digits if both endpoints round to the same value, returning 1, or 0 if the rounding is undecided (the first function returns GR_UNABLE instead, and sets err to a tight bound for the rounding error); compute 10^t to wp bits in time essentially linear in the size of t; and the number of bits, with guard bits, corresponding to prec digits.

Cite this page

The FLINT team, “_decfloat_set_round_arb_err, _decfloat_round_arb, _decfloat_round_arb_small, _decfloat_round_ball, _decimal_arb_10_pow_fmpz, _decimal_digits_to_bits (decimal.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/decimal/_decfloat_set_round_arb_err.html (generated 2026-10-20).