#3208

Fix shortest round-trip floating-point stringification

Opensb123sb123wants to merge intofrom

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

4
codecov[bot]1mo ago

Codecov Report

:x: Patch coverage is 78.94737% with 4 lines in 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
@@            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     
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
sb123sb1231mo ago

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 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