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

github.com/dtolnay/dtoa @1.0.11

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.0.11 ↗ · + Follow
23 symbols 36 edges 5 files 2 documented · 9%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

dtoa

github crates.io docs.rs build status

This crate provides fast conversion of floating point primitives to decimal strings. The implementation is a straightforward Rust port of Milo Yip's C++ implementation dtoa.h. The original C++ code of each function is included in comments.

See also [itoa] for printing integer primitives.

[dependencies]
dtoa = "1.0"

Example

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

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 dtoa::Buffer::new().format_finite(value) so a lower result indicates a faster library.

performance

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Extension points exported contracts — how you extend this code

Float (Interface)
A floating point number that can be written into a [`dtoa::Buffer`][Buffer]. This trait is sealed and cannot be impleme [2 …
src/lib.rs
Sealed (Interface)
(no doc) [2 implementers]
src/lib.rs

Core symbols most depended-on inside this repo

do_bench
called by 8
benches/bench.rs
format_finite
called by 2
src/lib.rs
write_exponent
called by 2
src/dtoa.rs
format
called by 1
src/lib.rs
is_nonfinite
called by 1
src/lib.rs
format_nonfinite
called by 1
src/lib.rs
write
called by 1
src/lib.rs
bench
called by 0
benches/bench.rs

Shape

Method 11
Function 8
Class 2
Interface 2

Languages

Rust100%

Modules by API surface

src/lib.rs11 symbols
src/diyfp.rs4 symbols
tests/test.rs3 symbols
src/dtoa.rs3 symbols
benches/bench.rs2 symbols

For agents

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

⬇ download graph artifact