Sunbeam Studios

Our open-source projects, here for you!

zmij (1.0.21)

Published 2026-03-26 11:07:04 +00:00 by siennathesane

Installation

[registry]
default = "gitea"

[registries.gitea]
index = "sparse+" # Sparse index
# index = "" # Git

[net]
git-fetch-with-cli = true
cargo add zmij@1.0.21

About this package

A double-to-string conversion algorithm based on Schubfach and yy

Ż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.

Dependencies

ID Version
no-panic ^0.1.36
num-bigint ^0.4
num-integer ^0.1
num_cpus ^1.8
opt-level ^1
rand ^0.10
ryu ^1
criterion ^0.8

Keywords

float
Details
Cargo
2026-03-26 11:07:04 +00:00
1
David Tolnay <dtolnay@gmail.com>
MIT
25 KiB
Assets (1)
Versions (1) View all
1.0.21 2026-03-26