Fix shortest round-trip floating-point stringification - #3208
Open
sb123sb123 wants to merge 2 commits into
Open
sb123sb123 wants to merge 2 commits into
sb123sb123 wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## devel #3208 +/- ##
==========================================
- Coverage 91.17% 91.11% -0.06%
==========================================
Files 206 206
Lines 9080 9099 +19
==========================================
+ Hits 8278 8290 +12
- Misses 802 809 +7 🚀 New features to boost your workflow:
|
Author
|
AppVeyor build 5688’s only failed job is the VS 2017 Release Coverage job. Its log shows all 81 CTest MemCheck tests passed, then the job exited 1 because |
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.
Fixes #3197.
The default floating-point stringifier currently emits fixed notation with
max_digits10digits after the decimal point, which can make nearbydoublevalues indistinguishable in failure messages. For the default round-trip precision, this change usesdefaultfloatand selects the first significant-digit precision that round-trips, preserving the sign of zero. Non-default precision values retain the existing fixed-format behavior, and infinities are handled separately.Adds a regression test for the adjacent values
5.000000000000001e-05and5e-05, and updates the affected approval baselines.Validation: MSVC 19.43 x64 Release build of
SelfTest; CTest passed 82/82 tests, including approval tests.clang-formatpassed on the changed C++ hunks.