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⋅10v|x| = M \cdot 10^v with MM an integer not divisible by 10: the number of digits of MM (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 vv (clamped to ±\pm DECFLOAT_EXP_CLAMP), and the scientific exponent EE with 10E≤∣x∣<10E+110^E \le |x| < 10^{E+1} (the last function returns 0 if EE 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-11-02).