-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
scientific notation incorrect decimal places #115737
Copy link
Copy link
Closed
Labels
A-fmtArea: `core::fmt`Area: `core::fmt`C-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-fmtArea: `core::fmt`Area: `core::fmt`C-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
I expected this all to be fine.
Instead, the final assertion fails, and the formatting is done like this in the final case:
Not sure why 2 decimal places are returned, looks like a bug.
This bug also exists in the beta or nightly versions, running in Rust Playground.
Discussion: https://users.rust-lang.org/t/scientific-notation-decimal-places/99682
Edit: after looking around the compiler code for the first time I think the problem is somewhere in either format_exact or format_exact_opt.