Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f18549cc56fabaa9429a30c0095c95ad9c829751
Ticket: 584825ffffffffffffffffffffffffffffffffff
test expr-22.8 should not be knownBug
User & Date: dgp on 2002-07-22 23:30:42
Changes

  1. icomment:
    Logged In: YES 
    user_id=80530
    
    
    This appears to trace back to a
    difference of opinion about how
    strtod() is supposed to be implemented.
    In particular, when given the 4 bytes
    'I', 'n', 'f', and '\0', how many bytes
    should strtod claim make up the
    valid double value?  Thus what
    should the endPtr be set to?
    
    Solaris strtod() claims that '\0' is
    part of the string rep of the double,
    so it sets endPtr to point one past
    the null.  Linux strtod() claims that
    '\0' is not part of the double, so
    it sets endPtr to point at the '\0'.
    
    Later that character gets turned
    back into '}' like it was before.
    
    It seems very strange to me that
    the Solaris strtod() handles the
    string "NaN" differently, and does
    not claim the trailing '\0' for it.
    
    FWIW, the compat/strtod.c offered
    with the Tcl sources recognizes
    neither Inf nor Nan.
    
    Finally, note that on Linux, the
    test expr-22.8 fails for a different
    reason.  There, the string "Inf"
    is happily converted to a legal
    double by Tcl_GetDoubleFromObj()
    on line 3112 of tclExecute.c.  So,
    Tcl goes ahead and performs the
    1 / Inf calculation and gets the
    correct answer: 0.0
    
    
  2. login: "dgp"
  3. mimetype: "text/plain"
  4. username: "dgp"