Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom float printer for consistent default float printing #41

Open
zkat opened this issue Apr 28, 2022 · 0 comments
Open

Custom float printer for consistent default float printing #41

zkat opened this issue Apr 28, 2022 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@zkat
Copy link
Member

zkat commented Apr 28, 2022

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.

@zkat zkat added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant