For |x| > 1, the infinities and NaN, titles' libc.prx stores EDOM and
raises FE_INVALID from acosf, quiet NaN included, and asinf also
raises FE_INVALID for a quiet NaN. acosf returned the same NaN bits
without either, and asinf set errno but raised nothing for a quiet NaN.
Both now call _Feraise with the invalid exception, which stores EDOM
and raises the flag in both units; the results are unchanged.
The acosf test asserted the old errno-preserving behaviour from a
FreeBSD reading; it now checks the titles' EDOM and FE_INVALID.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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]>
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]>
The only conflict was in GuestMath.cpp, where main's sinh tests and this
branch's asinh tests were inserted at the same place. Keep both: the asinh
checks follow the sinh ones.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The libc.prx that titles ship evaluates the rational step as
((Q(z) + g*P(z)) + 1) / ((Q(z) - g*P(z)) + 1), with its own ln 2 split
and coefficients in the double case, and returns 1 only for arguments
within half an epsilon of zero. main used a different rational form
with a doubling step and an epsilon-wide shortcut, which left about one
result in five one ulp away from titles.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
When the transformed string does not fit, strxfrm and wcsxfrm wrote
count - 1 characters and a terminator. The libc.prx bundled with titles
copies the first count characters and writes no terminator, as a plain
copy of count units would, and copies the terminator only when the whole
result fits. Both functions now do the same; the return value, the
length of the source, is unchanged. The tests that expected the
terminated prefix expect the measured units instead.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
strtof and wcstof returned the default quiet NaN for any NAN(...)
sequence. The libc.prx bundled with eleven titles reads the payload as
its strtod does, but into one 32-bit word: a blank after the first group
of digits ends it, the first 8 digits are kept and cut to 24 bits, the
result goes under the quiet bit with the sign, and a zero payload
becomes 1. HexNanPayload now takes the word count, two for double and
one for float, and the NaN table test checks the measured float bits
and end for all 64 inputs.
Co-Authored-By: Claude Opus 5.5 <[email protected]>