Files
AnyPS5/docs/dev/debt/changes/fix-printf-digits.md
DerKarussellbremserandClaude Fable 5.2 3066e4a9a7 fix(libc): generate printf's decimal digits as the bundled libc.prx does
%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
2026-11-19 04:07:25 +01:00

759 B

libc

change [num_put::do_put]

  • num_put::do_put (libc) follows the SDK 7.00 libc.prx that PPSA06416 ships, read from its disassembly and run, but formats through this library's snprintf. Its digits come from the extended-precision conversion that the titles' snprintf uses, so 1e10 at precision 22 is 9999999999.999999999999 and -2.5 at precision 0 is -3, as in that module; do_put itself has not been compared with it again. A precision so negative that the module's buffer of precision + 50 bytes cannot hold the result throws, where the module reads stale bytes. A stream locale without a ctype<char> facet leaves digits unwidened, as the console's C-locale facet does.