Commit 46e18aa
gh-NNNN: Add regression test for long-mantissa halfway-plus-epsilon
Covers the failure shape of a shortest-then-round strtod that
truncates its mantissa buffer without carrying a "non-zero tail was
dropped" flag through to the tie-break: the truncated form looks
exactly like a halfway case and rounds-to-even the wrong way.
The test constructs the midpoint between 1.0 and the next double
(1.0 + 2**-52), pads with 800 zeros, and appends a '1'. The value is
strictly above the halfway by 10**-857, so any bignum-capable strtod
must round UP — fast_float's Eisel-Lemire + digit-comparison fallback
handles this correctly, making the test pass as-is.
The test is placed alongside test_strtod.StrtodTests.test_particular
so it's part of the suite that already runs against every strtod
patch.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 925e587 commit 46e18aa
1 file changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
432 | 451 | | |
433 | 452 | | |
0 commit comments