Skip to content

Fix signs in floating-point duration formatting - #4981

Merged
vitaut merged 1 commit into
fmtlib:mainfrom
MokiMeow:fix/floating-duration-signs
Oct 24, 2026
Merged

vitaut merged 1 commit into
fmtlib:mainfrom
MokiMeow:fix/floating-duration-signs

Conversation

@MokiMeow

@MokiMeow MokiMeow commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Negative floating durations repeat the minus sign with multiple chrono conversions, while negative infinity loses it. Reuse write_sign() in both paths to emit one leading minus, preserving precision, padding and positive/NaN behavior.

Both regression tests fail before the fix. All 22 test executables pass with GCC C++11, Clang C++20 and Windows MSVC C++20. Header-only probes, source formatting and diff checks pass. Windows uses the default warning policy; enabling WERROR additionally hits an unchanged GCC pragma.

@MokiMeow
MokiMeow requested a review from vitaut as a code owner October 9, 2026 13:03
@vitaut
vitaut merged commit 434e30f into fmtlib:main Oct 24, 2026
47 checks passed
@vitaut

vitaut commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Merged, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants