kdl-rs
kdl-rs copied to clipboard
Custom float printer for consistent default float printing
Currently, we pretty much just throw floats at format!("{:?}")
and call it a day.
Unfortunately, this yields different results depending on Rust version (for example, 1.56 vs 1.60, so not even a big gap!).
So, we need to write our own that will follow a predictable pattern. Then we'll be able to re-enable the underscored tests that deal with floating point numbers that would otherwise fail.
Ideally, this formatter will be pretty smart about formatting exponent form (1.0e-10
etc), so the numbers also look nice, not just be correct.