🔬This is a nightly-only experimental API. (
flt2dec
)Expand description
Rust adaptation of the Grisu3 algorithm described in “Printing Floating-Point Numbers Quickly and Accurately with Integers”1. It uses about 1KB of precomputed table, and in turn, it’s very quick for most inputs.
Florian Loitsch. 2010. Printing floating-point numbers quickly and accurately with integers. SIGPLAN Not. 45, 6 (June 2010), 233-243. ↩
Constants
- ALPHAExperimental
- CACHED_POW10_FIRST_EExperimental
- CACHED_POW10_LAST_EExperimental
- GAMMAExperimental
Statics
- CACHED_POW10Experimental
Functions
- cached_powerExperimental
- format_exactExperimentalThe exact and fixed mode implementation for Grisu with Dragon fallback.
- format_exact_optExperimentalThe exact and fixed mode implementation for Grisu.
- format_shortestExperimentalThe shortest mode implementation for Grisu with Dragon fallback.
- format_shortest_optExperimentalThe shortest mode implementation for Grisu.
- max_pow10_no_more_thanExperimentalGiven
x > 0
, returns(k, 10^k)
such that10^k <= x < 10^(k+1)
.