FLINT3.7.0-dev

decfloat_get_digit_si, decfloat_get_limb_si, decfloat_set_digit_si, decfloat_set_limb_si

Synopsis#include <flint/decimal.h>
ulong decfloat_get_digit_si(const decfloat_t x, slong k, gr_ctx_t ctx)source
ulong decfloat_get_limb_si(const decfloat_t x, slong k, gr_ctx_t ctx)source
int decfloat_set_digit_si(decfloat_t res, const decfloat_t x, slong k, ulong c, gr_ctx_t ctx)source
int decfloat_set_limb_si(decfloat_t res, const decfloat_t x, slong k, ulong c, gr_ctx_t ctx)source

The digit c \in \{0, \ldots, 9\} of |x| at the absolute position 10^k, respectively the limb 0 \le c < B at position B^k (zero outside the mantissa and for special values), and x with that digit or limb replaced by c. Setting is exact (no rounding to the context precision, although the exponent limits are applied); the sign of x is kept, and setting a digit of zero gives a positive number. GR_DOMAIN is returned for an out-of-range c or a special value of x, and GR_UNABLE if the result would have more than DECIMAL_CONV_DIGITS_LIMIT digits.

Cite this page

The FLINT team, “decfloat_get_digit_si, decfloat_get_limb_si, decfloat_set_digit_si, decfloat_set_limb_si (decimal.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/decimal/decfloat_get_digit_si.html (generated 2026-10-20).