Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 87676f5fffaa7fd3937fd5921a838414ca1c05ae
Ticket: 3525462fffffffffffffffffffffffffffffffff
Expr documentation bug (expr {"0y" < "0x12"})
User & Date: zoltan3 on 2012-05-10 08:30:16
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Following can be seen in the expr's manual: expr {"0y" < "0x12"} returns 1, because it is done using string comparison after the second operand is converted to the string 18. But the command returns 0 in the Tcl interpreter.
    In the manual, part "STRING OPERATIONS" we can see: "Because of Tcl's tendency to treat values as numbers whenever possible, except in the case of the eq and ne operators.". And I expect the same on the ground of the part "OPERANDS": "Where possible, operands are interpreted as integer values."
    
    But is looks like a bug in the documentation. Only if both operands could be converted to numbers would their numerical values be compared.
    
  4. foundin changed to: "None"
  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: "zoltan3"
  10. subsystem changed to: "None"
  11. title changed to: "Expr documentation bug (expr {"0y" < "0x12"})"
  12. type changed to: "Bug"