Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2c97a15461e9b08d2e2a78f6d3d63ea1cd78003e
Ticket: 410043ffffffffffffffffffffffffffffffffff
"if" does not evaluate same as "expr"
User & Date: dkf on 2001-03-20 23:43:47
Changes

  1. closedate changed to: "2001-03-20T16:43:47"
  2. closer changed to: "dkf"
  3. icomment:
    Logged In: YES 
    user_id=79902
    
    This problem (a known feature of Tcl that is unlikely to
    ever be altered for a host of deep reasons) stems from the
    fact that 0.1 is not a precisely representable floating
    point number and that arguments to [expr] are [concat]enated
    before evaluation. Rerun the script with tcl_precision set
    to 17, or with the expression to pass to [expr] in {braces},
    and you'll get agreement between the "bare if" and the "if
    with expr".
    
    If this matters very much, use fixed-point arithmetic
    instead.
    
    
  4. login: "dkf"
  5. mimetype: "text/plain"
  6. resolution changed to: "Invalid"
  7. status changed to: "Closed"
  8. title changed to: ""if" does not evaluate same as "expr""
  9. username: "dkf"