Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f442407fa0069ff60f3b97f4fa75063a7b6193f94d199ef247a01155a829b91b
Ticket: 2dff98e0791720bdde656d47762553c1089684a4
format %A garbles negative, padded and infinite values
User & Date: serhiy.storchaka on 2026-10-18 09:21:47
Changes

  1. 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.
    
  2. login: "serhiy.storchaka"
  3. mimetype: "text/x-fossil-wiki"