MCPcopy Index your code
hub / github.com/dtolnay/zmij

github.com/dtolnay/zmij @1.0.21

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.0.21 ↗ · + Follow
84 symbols 148 edges 11 files 4 documented · 5%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Żmij

github crates.io docs.rs build status

Pure Rust implementation of Żmij, an algorithm to quickly convert floating point numbers to decimal strings.

This Rust implementation is a line-by-line port of Victor Zverovich's implementation in C++, https://github.com/vitaut/zmij.

Example

fn main() {
    let mut buffer = zmij::Buffer::new();
    let printed = buffer.format(1.234);
    assert_eq!(printed, "1.234");
}

Performance

The dtoa-benchmark compares this library and other Rust floating point formatting implementations across a range of precisions. The vertical axis in this chart shows nanoseconds taken by a single execution of zmij::Buffer::new().format_finite(value) so a lower result indicates a faster library.

performance

License

MIT license.

Extension points exported contracts — how you extend this code

Float (Interface)
(no doc) [2 implementers]
src/traits.rs
FloatTraits (Interface)
(no doc) [2 implementers]
src/lib.rs
UInt (Interface)
(no doc) [2 implementers]
src/traits.rs
Float (Interface)
(no doc) [2 implementers]
src/lib.rs
Sealed (Interface)
(no doc) [2 implementers]
src/lib.rs

Core symbols most depended-on inside this repo

umul128
called by 7
src/lib.rs
do_bench
called by 5
benches/bench.rs
umul128_hi64
called by 5
src/lib.rs
to_bits
called by 5
src/lib.rs
format_finite
called by 5
src/lib.rs
write_if
called by 4
src/lib.rs
format
called by 4
src/lib.rs
wrapping_sub
called by 3
src/traits.rs

Shape

Function 50
Method 22
Class 7
Interface 5

Languages

Rust100%

Modules by API surface

src/lib.rs45 symbols
tests/test.rs14 symbols
src/stdarch_x86.rs8 symbols
src/traits.rs6 symbols
src/tests.rs3 symbols
build.rs3 symbols
benches/bench.rs2 symbols
tests/ryu_comparison.rs1 symbols
tests/exhaustive.rs1 symbols
src/hint.rs1 symbols

For agents

$ claude mcp add zmij \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page