Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 176c28821b0e5b39d91381f6c5bb0f1a48a882a3
Ticket: 1962090fffffffffffffffffffffffffffffffff
Failure of string and expr commands
User & Date: nobody on 2008-05-11 22:46:30
Changes

  1. assignee changed to: "hobbs"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    I was trying to do some data validation, and ran across the following situation, which the example below demonstrates.
    
    % info patchlevel
    8.4.17
    % set s "5\n"
    5
    
    % string is double -strict $s
    1
    % expr {$s >= 0.0}
    1
    
    The string 's' is clearly not a double since it contains a control character, however the string test for double is returning true, which it should fail. The expr command is even more puzzling since the string is not a number, but the comparison returns true.
    
    IMHO both of these tests should return zero as the string is clearly not a double.
    
    
    
  4. foundin changed to: "obsolete: 8.4.17"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "nobody"
  10. subsystem changed to: "11. Conversions from String"
  11. title changed to: "Failure of string and expr commands"
  12. type changed to: "Bug"