Fix default format(float) result when the number is too big#2307
Merged
coolreader18 merged 4 commits intoRustPython:masterfrom Oct 26, 2020
Merged
Fix default format(float) result when the number is too big#2307coolreader18 merged 4 commits intoRustPython:masterfrom
coolreader18 merged 4 commits intoRustPython:masterfrom
Conversation
Before this change, format(1e16) returns '10000000000000000.0' in RustPython while CPython 3.7 returns '1e+16'. After this change, format(1e16) returns '1e+16' in RustPython too.
coolreader18
approved these changes
Oct 25, 2020
vm/src/format.rs
Outdated
Comment on lines
407
to
408
| // Using the Debug format here to prevent the automatic conversion of floats | ||
| // ending in .0 to their integer representation (e.g., 1.0 -> 1) |
Member
There was a problem hiding this comment.
You could probably remove this explanation, since it doesn't apply anymore.
Member
|
Thanks for contributing! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this change, format(1e16) returns '10000000000000000.0' in RustPython while CPython 3.7 returns '1e+16'.
After this change, format(1e16) returns '1e+16' in RustPython too.