Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 4855984250a48deb13493cdf1c06e397b4d256e8
Ticket: 218000ffffffffffffffffffffffffffffffffff
'Inf' not understood in expr
User & Date: dgp on 2002-07-22 07:54:12
Changes

  1. icomment:
    Logged In: YES 
    user_id=80530
    
    
    another data point on this:
    
    Tcl is not consistent in
    treating Inf and Nan:
    
    % expr {"nan"}
    domain error: argument not in valid range
    % expr {nan}
    domain error: argument not in valid range
    % expr {"inf"}
    floating-point value too large to represent
    % expr {inf}
    syntax error in expression "inf"
    
    The difference is due to line 1555 of
    tclParseExpr.c which specially looks for
    'n' or 'N' to give strtod() a chance to
    claim it.  
    
    It would be more consistent to either
    check for 'i' and 'I" there as well, or to
    check for none of them.
    
    Given the original report here, the better
    choice is probably to check for both
    so that all string reps of doubles generated
    by Tcl get recognized by Tcl as string reps
    of doubles with [expr] without quoting.
    
    
  2. login: "dgp"
  3. mimetype: "text/plain"
  4. title changed to: ""Inf" not understood in expr"
  5. username: "dgp"