Skip to content
Tcl Source Code History Of Ticket d0f7ba56f0e8f93b
Login

History Of Ticket d0f7ba56f0e8f93b

Artifacts Associated With Ticket d0f7ba56f0e8f93b

  1. Ticket change [379a054346] (rid 151670) by aspect on 2017-01-28 03:12:33:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      In the TIP#451 discussion on tcl-core it was shown that NaN is != to all strings, when provided as the first argument to ==/!=/>/</>=/<=.
      
      The cause seems to be that case INST_EQ in tclExecute.c shortcuts too quickly when type1 == TCL_NUMBER_NAN.  It should check that value2Ptr can be coerced to a number first.
      
      % set x "nan"
      % set y "gran"
      % expr {$x > $y} ;# expect 1
      0
      % expr {$x < $y} ;# expect 0
      0
      % expr {$y > $x} ;# expect 0
      0
      % expr {$y < $x} ;# expect 1
      1
      
      This is contrary to expr(n) "when all arguments to the operator allow numeric interpretations".
      
      Fixing this should probably consider the [pyk-emptystring] branch, which touches the same place to speed up a common case of comparison with "".
      
    5. foundin initialized to: "8.5+"
    6. is_private initialized to: "0"
    7. login: "aspect"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Important"
    11. status initialized to: "Open"
    12. submitter initialized to: "aspect"
    13. subsystem initialized to: "48. Number Handling"
    14. title initialized to:
      INST_EQ first-argument NaN shortcut is too aggressive
      
    15. type initialized to: "Bug"
  2. Ticket change [1961c40141] (rid 151712) by jan.nijtmans on 2017-02-01 15:00:28:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2457786.1253265"
    3. closer changed to: "jan.nijtmans"
    4. icomment:
      Thanks for the bug report, and the clear test-case. Fixed now on all active branches.
      
      The [pyk-emptystring] branch looks good to me. Since it's not a behavior change, only an optimization, I see no problem merging it to trunk. If anyone else reading this objects to that, please speak up! But ... it's unrelated to this issue.
      
    5. login: "jan.nijtmans"
    6. mimetype: "text/plain"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"
  3. Ticket change [d5fe72d12c] (rid 151724) by aspect on 2017-02-01 22:24:23:

    1. closedate changed to: "2457786.43360705"
    2. closer changed to: "aspect"
    3. icomment:
      Nice fix, Jan!  I was somehow entranced by all the gotos and didn't see such a way to make the code both more clear and correct.
      
      Thanks!
      
    4. login: "aspect"
    5. mimetype: "text/plain"