Ticket Change Details
Not logged in
Overview

Artifact ID: 379892be573f32dea4c349923df1c091e8fbae06d0367e2ff8940ec7c0fc9354
Ticket: 9c258a841a03860f24e52283b650c7823da2e8e6
format - undocumented type specifiers + possible bugs
User & Date: apnadkarni 2024-05-29 03:52:09
Changes

  1. icomment:
    Another inconsistency - manpage says
    
    *If neither h nor l nor L are present, the integer value is truncated to the same range as that produced by the int() function of the expr command (at least a 32-bit range, but determined by the value of the wordSize element of the tcl_platform array)*
    
    However, on Windows above does not hold
    
    ```
    % set x 0x7ffffffff
    0x7ffffffff
    % format %x $x
    ffffffff
    % format %llx [expr int($x)]
    7ffffffff
    ```
    
    The mathfunc manpage is also inconsistent with this behavior
    
    *The argument may be any numeric value. The integer part of arg is determined, and then the low order bits of that integer value up to the machine word size are returned as an integer value. For reference, the number of bytes in the machine word are stored in the wordSize element of the tcl_platform array.*
    
    I can start on fixing up these issues but I am not sure what the behavior is supposed to be. Are j, z, t supposed to match C? Is format %d supposed to match int() ? Is int() supposed to match tcl_platform(wordSize)? Which part of mismatches is to be fixed?...
    
  2. login: "apnadkarni"
  3. mimetype: "text/x-markdown"