lib-misc-utils · crate

kinogaki-float-text

Libraryenvironment

The shortest decimal text that reads back as the same f64, fast.

Repository
lib-misc-utils (kinogaki/lib-misc-utils)
Folder
libs/lib-misc-utils/crates/float-text
Source
4 files, 993 lines
Tests
3 files, 313 lines
depends onused by tests alonedependencies for tests alone are listed below, not drawn

What it is

The shortest decimal text that reads back as the same f64, fast.

The digits are the shortest that round-trip, and of those the closest to the exact value (ties to even): the same digits as Rust's {:e} (tests/against_std.rs) except at exact ties, where we round to even (as Ryu and zmij do), and the text is zmij's byte for byte. The digits come from one 128-bit scaling (src/shortest.rs), written eight at a time. The text is plain decimal when the value's scientific exponent E is in -5..=15 (123.456, 0.00001, always with a .: 1.0), and d.ddde±E outside (1.5e+16, 1e-6).

Depends on

None.

Third-party

None.

Used by

CrateRepositoryAsWhat it is
kinogaki-objOBJnormalWavefront OBJ, a format plugin: an OBJ file reads as one standard Geometry, its material libraries (mtllib) as MaterialX networks (materials) in a materials item before it; any polygons and polylines write as ...

Modules

Public types and traits

At the crate root

Structs FloatText