mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-12-04 16:40:32 +00:00
%e, %f and %g printed exact digits cut at a fitted position. The libc.prx bundled with PPSA10122 01.101.000 scales the value by a power of ten in three-part arithmetic and takes eight digits at a time, which is where the console's outputs that end one unit lower come from. The four such cases measured on firmware 11.60 are now reproduced. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011TXsSW8zeAgKgHLCFsYwM3
2.0 KiB
2.0 KiB
libc
change [%a and %A]
- %a and %A (libc) format a finite double as the
libc.prxthat titles ship does, instead of through the host: a subnormal is normalised (0x1p-1074), a shorter precision rounds half up on the dropped hexadecimal digits and a carry stays in the leading digit (%.3aof0x0.fffffffffffffp-1022is0x2.000p-1023), and-overrides0. Checked against the copies of PPSA13934, PPSA07923 and PPSA05916 on 7 million random formats, and measured on a console only in 28 cases (1, 0.5, 1.99951171875, 3.5,DBL_MAX,DBL_MIN, 1 - 2^-53 with%a,%A,%.3aand%-010.3a), where it gave the same text, as it did on a PS5 payload process (firmware 11.60) in 7 more cases, among them 5e-324 and -0.0; titles not measured. Along doubleis normalised the same way, with 16 hexadecimal digits (0x1.999999999999999ap-4for 0.1L). Infinities still go to the host; NaN keeps its sign and flags through the formatter on current main.
change [%e, %f and %g]
- %e, %f and %g (libc) generate the decimal digits of a finite
doubleorlong doublewith the method of thelibc.prxbundled with PPSA10122 01.101.000 (0x1700): the magnitude in three 32-bit parts is scaled by a power of ten in that arithmetic, at most 22 digits are taken eight at a time and rounded half up (%fof 1e22 is9999999999999999999999.000000). The digits depend on the caller's x87 precision and rounding mode, as the module's do. All 239doubletexts that a PS5 payload process printed on firmware 11.60 are reproduced, and 200,000 values with random flags, widths and precisions in each of six x87 modes give the module's text, run natively on Windows;long doubleand a title process are not measured on a console. A host whoselong doubleis not the x87 format keeps the earlier method (exact digits down to position4 * floor(k / 4) - 20). The wide printf family uses the same digits.