tanh returned the host's tanh, whose last bit differs from the titles' copy
on Windows. The titles' copy is FreeBSD msun's s_tanh.c over msun's expm1,
and it sets no errno. tanh now computes that algorithm over this file's
Expm1.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
trunc, ceil, floor and nearbyint and their float forms returned the
host's result, which on Windows passes a signalling NaN through
unchanged. The titles' copies follow FreeBSD msun, which returns x + x
for a NaN, so the NaN comes back quieted with its payload and sign; these
functions now do the same before calling the host for other arguments.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
log1p returned the host's log1p, whose last bit differs from the titles'
copy on Windows on 24,477,433 of 320 million random arguments. The titles'
copy is FreeBSD msun's s_log1p.c, and it sets EDOM at msun's NaN return,
for arguments below -1, -inf and negative NaNs, but not for log1p(-1).
log1p now computes that algorithm and sets EDOM there.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add the long-double siblings of _Cosh and _Sinh with the same scaled finite-input path, signed-zero handling and Dinkumware two-argument contracts. The reductions use a long-double ln2 split, and the scaled-range tests pin 64-bit results instead of the intermediate writer's output. Cover known values, signs and non-finite inputs in guest_math; record the unverified console results and exception behavior in the libc debt list.
nextafter and nextafterf returned the host's functions. On Windows they
set ERANGE for a step from zero to the smallest subnormal, which the
titles' copies do not, and pick a different NaN when both arguments are
NaNs. The titles' copies are FreeBSD msun's s_nextafter.c and
s_nextafterf.c with ERANGE at msun's overflow and underflow returns; both
functions now compute that, choosing the NaN explicitly so the compiler
cannot reorder msun's x + y.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Additive conflicts with main's newer libc math changes: the debt list keeps
both sides' entries (per entry), the GuestMath.cpp test functions and calls
from both sides are kept, and Math.cpp keeps both sides' independent changes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
expm1 returned the host's expm1, whose last bit differs from the titles'
copy on Windows on 35,152,346 of 320 million random arguments. The titles'
copy is FreeBSD msun's s_expm1.c, and it sets ERANGE only when a finite
argument overflows to infinity. expm1 now computes that algorithm and sets
ERANGE there.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
exp2f returned the host exp2, so its last bit and errno depended on the
host: on Windows the bits differ from the libc.prx that titles ship on
213,306,266 of the 2^32 floats. That libc.prx is msun's s_exp2f.c, setting
ERANGE only in its overflow and underflow branches. The port gives the same
bits and errno as PPSA07923's, PPSA05916's and PPSA13934's copies for every
argument.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
cbrtf returned the host cbrt, so its result depended on the host: on
Windows it differs from the libc.prx that titles ship on 1,303,357,444 of
the 2^32 floats. That libc.prx is msun's s_cbrtf.c, which gives the same
bits as PPSA07923's, PPSA05916's and PPSA13934's copies for every argument.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
They returned the host sin, cos and tan, so their last bit and errno
depended on the host: on Windows sinf differs from the libc.prx that titles
ship on 3,349,410 of the 2^32 floats, cosf on 3,382,210 and tanf on
303,874,018. That libc.prx is msun's s_sinf.c, s_cosf.c and s_tanf.c over
the double-precision kernels and e_rem_pio2f.c with k_rem_pio2.c; its
sincosf returns the same pair, and only an infinite argument sets EDOM.
The ports give the same bits and errno as PPSA07923's, PPSA05916's and
PPSA13934's copies for every argument.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
logf returned the host log, so its last bit and errno depended on the host:
on Windows the bits differ from the libc.prx that titles ship on 13,225,175
of the 2^32 floats. That libc.prx is msun's e_logf.c, setting ERANGE for
+-0 and EDOM for every argument with the sign bit set. The port gives the
same bits and errno as PPSA07923's and PPSA05916's copies for every
argument; the FMA-contracted copy of PPSA13934 differs by 1 ulp on 961,881.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
atanf returned the host atan, so its last bit depended on the host: on
Windows it differs from the libc.prx that titles ship on 6,481,820 of the
2^32 floats. That libc.prx is msun's s_atanf.c, which gives the same bits
as PPSA07923's, PPSA05916's and PPSA13934's copies for every argument.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
strtof and wcstof now set ERANGE for a decimal input whose nonzero
subnormal result is inexact, never for a hexadecimal nonzero subnormal,
and keep it for underflow to zero and overflow. This is what the libc.prx
bundled with PPSA08427 (J03547016) and PPSA03671 (J03848509) do when run
side by side with this libc. The earlier commit followed
libSceLibcInternal's _Stof, which leaves errno alone for hexadecimal under-
and overflow, but titles import these NIDs from their own libc.prx.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
- strtof, strtold, wcstof and wcstold return -0.0 when nothing converts
after a minus sign, unless the next character starts an inf or nan
spelling; strtod, wcstod and atof keep +0.0.
- strtof, strtold, wcstof and wcstold leave errno alone for hexadecimal
text that overflows or underflows.
- strtod and wcstod set ERANGE for hexadecimal text whose value lies
below the smallest subnormal and rounds up to it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
- strtol, strtoul, strtoll, strtoull and strtouq return 0 for a base
outside 0 and 2 to 36, leave the end at the start and set EINVAL;
strtoimax, strtoumax, _Stoull, _Stoul and the wide forms do the same
without errno.
- A 0x prefix with no hexadecimal digit after it (base 0 or 16) is no
conversion: the end stays at the start of the string.
- wcstol, wcstoll and wcstoimax take one sign, convert the rest with
wcstoull and clamp to the signed range with ERANGE, so "- 1" is -1
and "+\t-1" overflows.
- atoi, atol and atoll truncate strtoull's result.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK