FLINT3.7.0-dev

_decfloat_get_str_mode, _decfloat_get_digits, _decmag_get_digits, _decimal_write_number, _decimal_write_number_bound

Synopsis#include <flint/decimal.h>
char * _decfloat_get_str_mode(const decfloat_t x, int mode, gr_ctx_t ctx)source
slong _decfloat_get_digits(char * buf, fmpz_t t, const decfloat_t x, gr_ctx_t ctx)source
slong _decmag_get_digits(char * buf, fmpz_t t, const decmag_t x, gr_ctx_t ctx)source
slong _decimal_write_number(char * out, int negative, const char * digits, slong L, const fmpz_t t, int mode)source
slong _decimal_write_number_bound(slong L, const fmpz_t t)source

Output helpers. mode 0 prints in positional notation when the scientific exponent satisfies -6 \le E \le 20, mode 1 in scientific notation unless E = 0, and mode 2 (for radii) in positional notation when -3 \le E \le 5. The digit functions write the digits of |x| with trailing zeros stripped and set t to the exponent of the last digit, returning the number of digits; _decimal_write_number writes (-1)^{\mathit{negative}}\,\mathit{digits} \cdot 10^t without a null terminator and returns the number of characters, and _decimal_write_number_bound bounds that number.

Cite this page

The FLINT team, “_decfloat_get_str_mode, _decfloat_get_digits, _decmag_get_digits, _decimal_write_number, _decimal_write_number_bound (decimal.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/decimal/_decfloat_get_str_mode.html (generated 2026-10-20).