Overview
| Artifact ID: | 379a0543469f01667881dedbb5ba7d3734223bda |
|---|---|
| Ticket: | d0f7ba56f0e8f93b7efb5b09ebc30a824bdd577a
INST_EQ first-argument NaN shortcut is too aggressive |
| User & Date: | aspect on 2017-01-28 03:12:33 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed 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 "". - foundin changed to: "8.5+"
- is_private changed to: "0"
- login: "aspect"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Important"
- status changed to: "Open"
- submitter changed to: "aspect"
- subsystem changed to: "48. Number Handling"
- title changed to:
INST_EQ first-argument NaN shortcut is too aggressive
- type changed to: "Bug"