Commit Graph
4 Commits
Author SHA1 Message Date
B-HowellandClaude Opus 5.5 82c8a51391 fix(libc): saturate the hexadecimal strtod exponent past any digit run
The explicit binary exponent stopped accumulating near 1e9 while the
digits add 4 per character without bound, so a subject with a few
hundred million digits was classified against the wrong exponent:
0x1 followed by 3e8 zeros and p-1200000005000 kept errno, and a long
zero fraction with p+1000000000000 underflowed instead of overflowing.
Saturate the explicit exponent at 2^62, beyond what any addressable
digit run can offset, so the sum never overflows or changes sign.

Record that _Stod and _Stodx follow the title libc.prx rule for
hexadecimal underflow, unverified for libSceLibcInternal.

Refs #9691

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 03:49:24 -04:00
B-HowellandClaude Opus 5.5 6084ed65b4 fix(libc): match title libc.prx for hexadecimal strtod underflow
Classify hexadecimal strtod and wcstod input from its own digits rather
than a long double approximation. As measured on God of War Ragnarok's
bundled libc.prx, ERANGE is set only on overflow or when the exact value
is below 2^-1074, and a value between 2^-1075 and 2^-1074 becomes the
smallest subnormal only from 2^-1075 * (1 + 2^-52) up.

Refs #9691

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 03:49:24 -04:00
Dean Galvin c071f3d240 Merge main (check commit for the public_headers fix) 2026-10-25 12:43:32 +13:00
MarcZX10 4fc7390a7f test(libc): cover decimal strtod subnormal errno 2026-10-24 16:37:42 +00:00