Skip to content

Conversation

@lemire
Copy link

@lemire lemire commented Dec 7, 2025

Replace the f32 test case with an f64 equivalent to improve coverage for parsing large digit counts in double-precision floating-point conversion. Specifically, this PR updates the many_digits test in library/coretests/tests/num/dec2flt/parse.rs to test f64 (double-precision) parsing instead of f32 (single-precision).

The test verifies that decimal strings with an excessive number of digits (beyond Decimal::MAX_DIGITS) are parsed correctly, ensuring proper truncation of insignificant digits. Previously, the same test was repeated twice (see comment #86761 (comment) by @Viatorus).

Changes

  • Replaced the duplicated f32 test case with an equivalent f64 test case.
  • Updated the expected bit pattern and input string to a very long decimal with many trailing zeros, testing the limits of f64 precision.

Replace the f32 test case with an f64 equivalent to improve coverage
for parsing large digit counts in double-precision floating-point
conversion.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 7, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 7, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@Mark-Simulacrum
Copy link
Member

Any reason to replace the test rather than adding a new one with the f64 case? That seems better to me, though I'm not familiar with this particular area of code.

@lemire
Copy link
Author

lemire commented Dec 13, 2025

Any reason to replace the test rather than adding a new one with the f64 case? That seems better to me, though I'm not familiar with this particular area of code.

There were two f32 tests, but really just one duplicated.

This PR replaces one of the f32 tests by the equivalent f64 test, thus improving coverage.

It seems that this PR was the original goal.

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

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants