Skip to content

PR #2195: StrFormat: honor zero padding in slow scientific conversions - #2217

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_999151724
Oct 19, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_999151724

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

PR #2195: StrFormat: honor zero padding in slow scientific conversions

Imported from GitHub PR #2195

Slow scientific %e and %g conversions dropped zero padding: %010.0e and %010.1g returned 3e+38 instead of 000003e+38 for 0x1p128.

Both emitters now append the computed zeros after any sign.

The regression covers both exponent signs, positive and negative values, lowercase and uppercase conversions, sign flags, and alternate form. It fails before and passes after the fix. All eight existing str_format test targets pass in both runs with GCC 13.3, C++17, and CMake Release.

Fixes #2194

Merge 7429268 into d522178

Merging this change closes #2195

@google-cla

google-cla Bot commented Oct 15, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@copybara-service
copybara-service Bot force-pushed the test_999151724 branch 2 times, most recently from 8f33fab to 8889fda Compare October 19, 2026 22:32
Imported from GitHub PR #2195

Slow scientific `%e` and `%g` conversions dropped zero padding: `%010.0e` and `%010.1g` returned `3e+38` instead of `000003e+38` for `0x1p128`.

Both emitters now append the computed zeros after any sign.

The regression covers both exponent signs, positive and negative values, lowercase and uppercase conversions, sign flags, and alternate form. It fails before and passes after the fix. All eight existing str_format test targets pass in both runs with GCC 13.3, C++17, and CMake Release.

Fixes #2194

Merge 7429268 into d522178

Merging this change closes #2195

PiperOrigin-RevId: 1002666774
@copybara-service
copybara-service Bot merged commit fb7ad83 into master Oct 19, 2026
3 of 4 checks passed
@copybara-service
copybara-service Bot deleted the test_999151724 branch October 19, 2026 23:13
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.

[Bug]: StrFormat omits zero padding in slow scientific %e and %g conversions

1 participant