Closed jamesgraves closed 1 year ago
As of at least Rust v1.67.1, fmt::Debug printing of f64 uses scientific notation for sufficiently large / small values.
fmt::Debug
f64
This code:
let f: f64 = 1.23456789012345e308; println!("{}", f); println!("{:?}", f);
prints this:
123456789012345000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 1.23456789012345e308
Indeed, fixed this as part of a Rust bump. Thanks!
As of at least Rust v1.67.1,
fmt::Debug
printing off64
uses scientific notation for sufficiently large / small values.This code:
prints this: