FLINT3.7.0-dev

decfloat_digits, decfloat_limbs, _decfloat_mant_digits, _decfloat_val10_clamped, decfloat_get_sci_exp, decfloat_get_sci_exp_si

Synopsis#include <flint/decimal.h>
slong decfloat_digits(const decfloat_t x, gr_ctx_t ctx)source
slong decfloat_limbs(const decfloat_t x, gr_ctx_t ctx)source
slong _decfloat_mant_digits(const decfloat_t x, gr_ctx_t ctx)source
slong _decfloat_val10_clamped(const decfloat_t x, gr_ctx_t ctx)source
void decfloat_get_sci_exp(fmpz_t E, const decfloat_t x, gr_ctx_t ctx)source
int decfloat_get_sci_exp_si(slong * E, const decfloat_t x, gr_ctx_t ctx)source

Writing |x| = M \cdot 10^v with M an integer not divisible by 10: the number of digits of M (the smallest precision at which x is representable; decimal numbers do not track significance, so this is a property of the value), the number of limbs of the mantissa, the number of digits of the limb mantissa including the trailing zeros of its lowest limb, the exponent v (clamped to \pm DECFLOAT_EXP_CLAMP), and the scientific exponent E with 10^E \le |x| < 10^{E+1} (the last function returns 0 if E does not fit in a word). The digit counts are zero for special values; the value must be nonzero and finite for the exponent functions.

Cite this page

The FLINT team, “decfloat_digits, decfloat_limbs, _decfloat_mant_digits, _decfloat_val10_clamped, decfloat_get_sci_exp, decfloat_get_sci_exp_si (decimal.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/decimal/decfloat_digits.html (generated 2026-10-20).