FLINT3.7.0-dev

_decfloat_set_round_fmpz_2exp_err, _decfloat_set_round_fmpz_2exp_scaled, _decfloat_set_exact_decimal_fmpz_2exp, _decfloat_set_round_arf_small, _decfloat_maybe_dyadic

Synopsis#include <flint/decimal.h>
int _decfloat_set_round_fmpz_2exp_err(decfloat_t res, const fmpz_t m, const fmpz_t t, slong prec, int rnd, decimal_rounding_info * info, decmag_ptr err, gr_ctx_t ctx)source
int _decfloat_set_round_fmpz_2exp_scaled(decfloat_t res, const fmpz_t m, slong t, slong prec, int rnd, decimal_rounding_info * info, decmag_ptr err, gr_ctx_t ctx)source
int _decfloat_set_exact_decimal_fmpz_2exp(decfloat_t res, const fmpz_t m, const fmpz_t t, slong prec, gr_ctx_t ctx)source
int _decfloat_set_round_arf_small(decfloat_t res, const arf_t x, slong prec, int rnd, decimal_rounding_info * info, gr_ctx_t ctx)source
int _decfloat_maybe_dyadic(const decfloat_t x, gr_ctx_t ctx)source

The binary-to-decimal conversion of m 2^t: correctly rounded with an optional error bound; by exact integer arithmetic on a scaled truncation when the sizes are moderate (returning 0 when they are too large, so that the caller uses arb); setting res to m 2^t and returning 1 when it is exactly representable with at most prec digits; and a fast path for a short arf with a moderate exponent. _decfloat_maybe_dyadic is a cheap necessary condition for x to be a dyadic rational.

Cite this page

The FLINT team, “_decfloat_set_round_fmpz_2exp_err, _decfloat_set_round_fmpz_2exp_scaled, _decfloat_set_exact_decimal_fmpz_2exp, _decfloat_set_round_arf_small, _decfloat_maybe_dyadic (decimal.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/decimal/_decfloat_set_round_fmpz_2exp_err.html (generated 2026-10-20).