precise

Crates.ioprecise
lib.rsprecise
version0.1.9
sourcesrc
created_at2019-04-21 21:01:10.11701
updated_at2023-08-13 02:24:00.957069
descriptionFull precision decimal representation of f64
homepage
repositoryhttps://github.com/dtolnay/precise
max_upload_size
id129369
size23,829
Lanthanum (github:zxtn:lanthanum)

documentation

https://docs.rs/precise

README

Precise float to string

github crates.io docs.rs build status

This crate computes the decimal representation of the single rational number whose value is mathematically equal to a given float.

Note that this is almost never an appropriate way to print user-facing values. For that, use the ryu crate instead.

[dependencies]
precise = "0.1"

Example

fn main() {
    // 0.1000000000000000055511151231257827021181583404541015625
    println!("{}", precise::to_string(0.1));
}

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.
Commit count: 73

cargo fmt