Skip to content

Conversation

@lemire
Copy link
Contributor

@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
Contributor 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.

@Mark-Simulacrum
Copy link
Member

@bors r+

Sounds good, thanks!

@bors
Copy link
Collaborator

bors commented Dec 14, 2025

📌 Commit bb549da has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 14, 2025
bors added a commit that referenced this pull request Dec 15, 2025
Rollup of 7 pull requests

Successful merges:

 - #149744 (test: update duplicate many_digits test to use f64 instead of f32)
 - #149946 (mir_build: Move and rename code for partitioning match candidates)
 - #149987 (Move ambient cdb discovery from compiletest to bootstrap)
 - #149990 (Improve amdgpu docs: Mention device-libs and xnack)
 - #149994 (Allow vector types for amdgpu)
 - #149997 (Link POSIX instead of Linux manual for Instant)
 - #150010 (Correct library linking for hexagon targets in run-make tests)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 18fa9dd into rust-lang:main Dec 15, 2025
11 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 15, 2025
rust-timer added a commit that referenced this pull request Dec 15, 2025
Rollup merge of #149744 - lemire:main, r=Mark-Simulacrum

test: update duplicate many_digits test to use f64 instead of f32

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

4 participants