Commit 2f21cac
gh-NNNN: Use _PyWuffs_strtod in float string parsing, replacing _Py_dg_strtod
Replace all calls to _Py_dg_strtod() with _PyWuffs_strtod() from the
newly-vendored Wuffs float-parsing adapter:
* Python/pystrtod.c: _PyOS_ascii_strtod() now calls _PyWuffs_strtod()
(the Wuffs Eisel-Lemire + HPD parser) instead of Gay's _Py_dg_strtod().
* Objects/floatobject.c: double_round() uses _PyWuffs_strtod() for the
string-to-double step when converting back from a rounded decimal string.
_PyWuffs_strtod() is a correctly-rounded, Bigint-free, platform-strtod-free
replacement. It uses the Eisel-Lemire fast path for ~99.9999% of inputs and
falls back to the High Precision Decimal (HPD) algorithm for the remainder.
Both paths are self-contained within the vendored Wuffs header.
After this change _Py_dg_strtod() has no callers outside dtoa.c itself
and will be removed in the next commit.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 75a180f commit 2f21cac
2 files changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| |||
939 | 942 | | |
940 | 943 | | |
941 | 944 | | |
942 | | - | |
| 945 | + | |
943 | 946 | | |
944 | 947 | | |
945 | 948 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
7 | 11 | | |
8 | 12 | | |
9 | 13 | | |
| |||
101 | 105 | | |
102 | 106 | | |
103 | 107 | | |
104 | | - | |
| 108 | + | |
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
| |||
0 commit comments