Module grisu
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. ↩
Functions
- cached_power
- format_exact The exact and fixed mode implementation for Grisu with Dragon fallback.
- format_exact_opt The exact and fixed mode implementation for Grisu.
- format_shortest The shortest mode implementation for Grisu with Dragon fallback.
- format_shortest_opt The shortest mode implementation for Grisu.
-
max_pow10_no_more_than
Given
x > 0, returns(k, 10^k)such that10^k <= x < 10^(k+1).