Constant core::num::flt2dec::MAX_SIG_DIGITS

source ·
pub const MAX_SIG_DIGITS: usize = 17;
🔬This is a nightly-only experimental API. (flt2dec)
Expand description

The minimum size of buffer necessary for the shortest mode.

It is a bit non-trivial to derive, but this is one plus the maximal number of significant decimal digits from formatting algorithms with the shortest result. The exact formula is ceil(# bits in mantissa * log_10 2 + 1).