-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
New floating-to-decimal formatting routine #24612
Merged
Merged
Commits on May 6, 2015
-
core: added core::num::flt2dec for floating-point formatting.
This is a fork of the flt2dec portion of rust-strconv [1] with a necessary relicensing (the original code was licensed CC0-1.0). Each module is accompanied with large unit tests, integrated in this commit as coretest::num::flt2dec. This module is added in order to replace the existing core::fmt::float method. The forked revision of rust-strconv is from 2015-04-20, with a commit ID 9adf6d3571c6764a6f240a740c823024f70dc1c7. [1] https://github.com/lifthrasiir/rust-strconv/
Configuration menu - View commit details
-
Copy full SHA for c82da7a - Browse repository at this point
Copy the full SHA c82da7aView commit details -
core: made the core formatter to use a new flt2dec.
As a side effect `core::fmt::float` is gone now. This also slightly changes the float output, so this is: [breaking-change]
Configuration menu - View commit details
-
Copy full SHA for 5aa9f38 - Browse repository at this point
Copy the full SHA 5aa9f38View commit details -
Configuration menu - View commit details
-
Copy full SHA for f9bfda0 - Browse repository at this point
Copy the full SHA f9bfda0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 85424c4 - Browse repository at this point
Copy the full SHA 85424c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8a195f0 - Browse repository at this point
Copy the full SHA 8a195f0View commit details -
The bug involves the incorrect logic for `core::num::flt2dec::decoder`. This makes some numbers in the form of 2^n missing one final digits, which breaks the bijectivity criterion. The regression tests have been added, and f32 exhaustive test is rerun to get the updated result.
Configuration menu - View commit details
-
Copy full SHA for 97ea7c1 - Browse repository at this point
Copy the full SHA 97ea7c1View commit details -
core: updated for the master changes.
The master no longer has `std::num::Float`, so a generic `ldexp` is not readily available. `DecodableFloat::ldexpi` works around this.
Configuration menu - View commit details
-
Copy full SHA for a641b05 - Browse repository at this point
Copy the full SHA a641b05View commit details -
core: use banker's rounding for the exact mode in flt2dec.
For the shortest mode the IEEE 754 decoder already provides an exact rounding range accounting for banker's rounding, but it was not the case for the exact mode. This commit alters the exact mode algorithm for Dragon so that any number ending at `...x5000...` with even `x` and infinite zeroes will round to `...x` instead of `...(x+1)` as it was. Grisu is not affected by this change because this halfway case always results in the failure for Grisu.
Configuration menu - View commit details
-
Copy full SHA for 3d34e17 - Browse repository at this point
Copy the full SHA 3d34e17View commit details
Commits on May 9, 2015
-
Configuration menu - View commit details
-
Copy full SHA for 1aecd17 - Browse repository at this point
Copy the full SHA 1aecd17View commit details
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.