Skip to content

<format>: fix invalid handling of large precisions#2157

Merged
StephanTLavavej merged 9 commits into
microsoft:mainfrom
miscco:GH2156_format_precision
Sep 11, 2021
Merged

<format>: fix invalid handling of large precisions#2157
StephanTLavavej merged 9 commits into
microsoft:mainfrom
miscco:GH2156_format_precision

Conversation

@miscco
Copy link
Copy Markdown
Contributor

@miscco miscco commented Aug 25, 2021

We were not properly setting the _Exponent_start variable so that we would append trailing zeroes after the exponent

There is some refactoring, so that the handling of trailing zeros is centralized in a single switch. Also we were needlessly overwriting _Buffer_start which confused me endlessly

Fixes #2156

@miscco miscco requested a review from a team as a code owner August 25, 2021 12:16
Comment thread stl/inc/format Outdated
Comment thread stl/inc/format
Comment thread tests/std/tests/P0645R10_text_formatting_formatting/test.cpp Outdated
@CaseyCarter CaseyCarter added the bug Something isn't working label Aug 25, 2021
@StephanTLavavej StephanTLavavej changed the title <fmt> fix invalid handling of large precisions <format>: fix invalid handling of large precisions Aug 25, 2021
@StephanTLavavej StephanTLavavej added the format C++20/23 format label Aug 25, 2021
Comment thread stl/inc/format Outdated
Comment thread stl/inc/format
Comment thread stl/inc/format Outdated
@StephanTLavavej StephanTLavavej removed their assignment Sep 3, 2021
@StephanTLavavej
Copy link
Copy Markdown
Member

I'm mirroring this to the MSVC-internal repo now. Please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit e652aa2 into microsoft:main Sep 11, 2021
@StephanTLavavej
Copy link
Copy Markdown
Member

Thanks for fixing this bug affecting my favorite floating-point notation! 🐞 🐛 ✔️

@miscco miscco deleted the GH2156_format_precision branch September 11, 2021 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working format C++20/23 format

Projects

None yet

Development

Successfully merging this pull request may close these issues.

<format>: Hex float precision is capped

7 participants