Artifacts Associated With Ticket 2dff98e079
Ticket change [df84203e20] (rid 258350) by serhiy.storchaka on 2026-10-16 22:13:57:
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
<nowiki>[format %A]</nowiki> overwrites the second character of the result with "x", assuming that it starts with "0X": <verbatim> format %A -1.5 ;# -xX1.8p+0 format %+A 1.0 ;# +xX1p+0 format %10A 1.5 ;# x0X1.8p+0 format %A Inf ;# IxF </verbatim> Only plain positive values come out right (0x1.8p+0). The code came with %a/%A in [5cfe15b5d6].
- foundin initialized to: "9.0.5, 9.1.0"
- login: "serhiy.storchaka"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "serhiy.storchaka"
- subsystem initialized to: "16. Commands A-H"
- title initialized to:
format %A garbles negative, padded and infinite values
- type initialized to: "Bug"
Ticket change [fb24a449fa] (rid 258357) by serhiy.storchaka on 2026-10-16 22:18:07:
- icomment:
Proposed fix in branch [/timeline?r=format-A-prefix|format-A-prefix]: lowercase the "0X" prefix and the "P" exponent marker where they are, which is after the padding and the sign, and leave INF alone. Test format-19.5.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [c63cde0537] (rid 258384) by jan.nijtmans on 2026-10-17 06:54:38:
- assignee changed to: "aku"
- closer changed to: "nobody"
- comment changed to:
<nowiki>[format %A]</nowiki> overwrites the second character of the result with "x", assuming that it starts with "0X": <verbatim> format %A -1.5 ;# -xX1.8p+0 format %+A 1.0 ;# +xX1p+0 format %10A 1.5 ;# x0X1.8p+0 format %A Inf ;# IxF </verbatim> Only plain positive values come out right (0x1.8p+0). The code came with %a/%A in [5cfe15b5d6].
- icomment:
+1 Please go ahead
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
Ticket change [2f24eb1b1f] (rid 258446) by serhiy.storchaka on 2026-10-17 07:25:45:
- icomment:
Merged into main in [9336b96c43] and into 9.0 in [06f25062c2].
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- icomment:
Ticket change [4b524ff3ba] (rid 258950) by jan.nijtmans on 2026-10-18 08:53:28:
- assignee changed to: "jan.nijtmans"
- icomment:
Just one thing left to fix. With msvcrt (not ucrt): <pre> ==== format-19.5 %A with sign, padding and Inf, bug [2dff98e079] FAILED ==== Contents of test case: # explicit precision: without it MSVC prints all 13 hex digits list [format %.1A 1.5] [format %.1A -1.5] [format %+.0A 1.0] [format "% .0A" 1.0] [format %10.1A 1.5] [format %-10.0A| -2.0] [format %A Inf] [format %A -Inf] ---- Result was: 0x1.8p+0 -0x1.8p+0 +0x1p+0 { 0x1p+0} { 0x1.8p+0} {-0x1p+1 |} 0x1.#INF00p+0 -0x1.#INF00p+0 ---- Result should have been (exact matching): 0x1.8p+0 -0x1.8p+0 +0x1p+0 { 0x1p+0} { 0x1.8p+0} {-0x1p+1 |} INF -INF ==== format-19.5 FAILED </pre> Matching with -glob would be easiest: If it contains 'INF' that should be OK - login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- status changed to: "Pending"
Ticket change [5cdae507bc] (rid 258953) by jan.nijtmans on 2026-10-18 08:59:20:
- icomment:
My proposal [6715b0e7eddf95f|here] (unless someone has a better idea)
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [a6dc151432] (rid 258954) by jan.nijtmans on 2026-10-18 08:59:32:
- icomment:
My proposal [6715b0e7eddf95f|here] (unless someone has a better idea)
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [de90a6a88b] (rid 258955) by jan.nijtmans on 2026-10-18 09:00:57:
- icomment:
My proposal [96715b0e7e|here] (unless someone has a better idea)
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [f442407fa0] (rid 258959) by serhiy.storchaka on 2026-10-18 09:21:47:
- icomment:
Another option, done in [f5bb9702a9]: format infinities ourselves instead of passing them to the C library, as Python does. msvcrt gets them wrong for all float conversions, not only <tt>%A</tt> (<tt>1.#INF00e+000</tt>, <tt>1.#INF</tt> even for <tt>%G</tt>). Now they are <tt>inf</tt> or <tt>INF</tt> (for <tt>%A</tt>, <tt>%E</tt>, <tt>%G</tt>) with the sign flags, padded with spaces, as C99 specifies; the output on glibc and ucrt does not change. format-19.5 is exact again, new test format-19.6. Tested with a mingw msvcrt build on Windows 11: format.test passes, and fails without this change. NaN cannot get there, it is rejected earlier.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [0252629989] (rid 259097) by jan.nijtmans on 2026-10-18 21:07:22:
- closedate changed to: "2461332.3801244674"
- closer changed to: "jan.nijtmans"
- icomment:
Agreed! Follow-up patch now merged too. Thanks!
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- status changed to: "Closed"
Ticket change [51cb0e070f] (rid 260148) by serhiy.storchaka on 2026-10-23 09:32:19:
- icomment:
The infinity part of the follow-up [185825858e] was backported to 8.6 in [326e1bf923] for [40f315bc23]. 8.6 has no %a/%A.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- icomment: