text_fonts

module std::float_digitssource

The shortest decimal digits of a float that read back to the same value, by Ryu (Ulf Adams, "Ryu: fast float-to-string conversion", PLDI 2018), which std::format writes floats with (LANGUAGE_SPEC.md section 6.5). Integer arithmetic only, so compile-time code formats floats too.

type Decimalsource

exp type Decimal = struct

A finite float's magnitude as digits times ten to the exponent, with as few digits as read back to the same float; zero is 0 times 10^0.

Fields

exp digits: u64
exp exponent: i64

fn shortestsource

exp fn shortest(value: f64) -> Decimal

fn shortestsource

exp fn shortest(value: f32) -> Decimal