Fixes #3197.
The default floating-point stringifier currently emits fixed notation with max_digits10 digits after the decimal point, which can make nearby double values indistinguishable in failure messages. For the default round-trip precision, this change uses defaultfloat and 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-05 and 5e-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-format passed on the changed C++ hunks.
Activity
4AppVeyor 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 codecov was not recognized; the other four AppVeyor jobs passed. This looks like a coverage-uploader/environment failure after the tests, not a test failure. Could this check be retried or the uploader step be handled for this PR? AppVeyor log
Codecov Report
:x: Patch coverage is
78.94737%with4 linesin your changes missing coverage. Please review. :white_check_mark: Project coverage is 91.11%. Comparing base (222e233) to head (e754f31).Additional details and impacted files
:rocket: New features to boost your workflow: