_decmag_set_ui, _decmag_set_ui_lower, _decmag_set_fmpz, _decmag_set_fmpz_lower, _decmag_set_d, _decmag_set_10exp_si, _decmag_set_10exp_fmpz, _decmag_set_ui_10exp_si, _decmag_set_ui_10exp_fmpz, _decmag_set_ui_10exp_fmpz_lower, _decmag_set_uiui_10exp_fmpz, _decmag_set_decfloat, _decmag_set_decfloat_lower, _decmag_set_mag, _decmag_get_decfloat, _decmag_get_fmpq, _decmag_get_d, _decmag_get_mag
#include <flint/decimal.h>void _decmag_set_uiui_10exp_fmpz(decmag_t res, ulong hi, ulong lo, ulong hi_radix, int sticky, const fmpz_t e, gr_ctx_t ctx)sourcevoid _decmag_set_decfloat(decmag_t res, const decfloat_t x, gr_ctx_t ctx)sourcevoid _decmag_set_decfloat_lower(decmag_t res, const decfloat_t x, gr_ctx_t ctx)sourceint _decmag_get_decfloat(decfloat_t res, const decmag_t x, gr_ctx_t ctx)sourceConversions. The absolute value is taken of signed inputs. set_uiui_10exp_fmpz sets res to an upper bound for (\mathrm{hi} \cdot \mathrm{hi\_radix} + \mathrm{lo} + \varepsilon) 10^e where hi_radix is a power of ten and 0 \le \varepsilon < 1 with \varepsilon > 0 iff sticky is set. The conversion to decfloat_t is exact. set_mag gives the tightest upper bound at the radius precision when the binary exponent is at most a few thousand (using exact integer arithmetic on a scaled truncation), and a bound within a relative error of about 10^{-12} (rounded up to the radius precision) otherwise, computed from a fixed-point approximation of \log_{10} 2 and a double-precision power of ten with a safety margin; this covers arbitrarily large exponents, in time essentially independent of their size.
The FLINT team, “_decmag_set_ui, _decmag_set_ui_lower, _decmag_set_fmpz, _decmag_set_fmpz_lower, _decmag_set_d, _decmag_set_10exp_si, _decmag_set_10exp_fmpz, _decmag_set_ui_10exp_si, _decmag_set_ui_10exp_fmpz, _decmag_set_ui_10exp_fmpz_lower, _decmag_set_uiui_10exp_fmpz, _decmag_set_decfloat, _decmag_set_decfloat_lower, _decmag_set_mag, _decmag_get_decfloat, _decmag_get_fmpq, _decmag_get_d, _decmag_get_mag (decimal.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/decimal/_decmag_set_ui.html (generated 2026-10-20).
@misc{flint-doc-decimal-decmag-set-ui,
author = {{The FLINT team}},
title = {{\_decmag\_set\_ui, \_decmag\_set\_ui\_lower, \_decmag\_set\_fmpz, \_decmag\_set\_fmpz\_lower, \_decmag\_set\_d, \_decmag\_set\_10exp\_si, \_decmag\_set\_10exp\_fmpz, \_decmag\_set\_ui\_10exp\_si, \_decmag\_set\_ui\_10exp\_fmpz, \_decmag\_set\_ui\_10exp\_fmpz\_lower, \_decmag\_set\_uiui\_10exp\_fmpz, \_decmag\_set\_decfloat, \_decmag\_set\_decfloat\_lower, \_decmag\_set\_mag, \_decmag\_get\_decfloat, \_decmag\_get\_fmpq, \_decmag\_get\_d, \_decmag\_get\_mag (decimal.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/decimal/_decmag_set_ui.html},
note = {Generated 2026-10-20}
}