Artifacts Associated With Ticket d0f7ba56f0e8f93b
Ticket change [379a054346] (rid 151670) by aspect on 2017-01-28 03:12:33:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- 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 "". - foundin initialized to: "8.5+"
- is_private initialized to: "0"
- login: "aspect"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "aspect"
- subsystem initialized to: "48. Number Handling"
- title initialized to:
INST_EQ first-argument NaN shortcut is too aggressive
- type initialized to: "Bug"
Ticket change [1961c40141] (rid 151712) by jan.nijtmans on 2017-02-01 15:00:28:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2457786.1253265"
- closer changed to: "jan.nijtmans"
- 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.
- login: "jan.nijtmans"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [d5fe72d12c] (rid 151724) by aspect on 2017-02-01 22:24:23:
- closedate changed to: "2457786.43360705"
- closer changed to: "aspect"
- 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!
- login: "aspect"
- mimetype: "text/plain"