Artifacts Associated With Ticket 960210ffffffffff
Ticket change [a556f8d122] (rid 110357) by nobody on 2004-05-25 15:21:00:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The expr command, when given the literal string "Nan" (quotes included), tries to convert Nan to a number and yields the error: domain error: argument not in valid range Clearly, what's inside quotes is not expr's business, it shouldn't open that box ! Also notice that this strange behavior is insensitive to whitespace, but it to other characters: expr {"Nan xyz"} works correctly. - foundin initialized to: "final: 8.3.5"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "45. Parsing and Eval"
- title initialized to: "expr {"Nan"}"
- type initialized to: "Bug"
Ticket change [7fe12eed2f] (rid 97637) by ferrieux on 2004-05-25 22:34:34:
- icomment:
Logged In: YES user_id=496139 This was me (sorry I hadn't logged in). Maybe one useful detail: The same problem arises if the Nan results from an evaluation: proc foobar {} {return Nan} expr {[foobar]} So we can reinterpret this as: "expr systematically tries to convert its final result to a number". This is at odds with Tcl's lazy conversion spirit, and definitely a bug ! -Alex - login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [807079cc28] (rid 116865) by dgp on 2004-05-26 03:32:49:
- icomment:
Logged In: YES user_id=80530 be sure to reconcile any changes here with Bug 218000
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [a117de2d74] (rid 109662) by msofer on 2004-05-26 04:46:54:
- assignee changed to: "dkf"
Ticket change [f7239f7e90] (rid 91321) by dkf on 2004-05-26 05:31:31:
- icomment:
Logged In: YES user_id=79902 Tcl's NaN handling is an utter mess. But [expr] is (IIRC) defined to be aggressive about trying to convert its result into numeric form.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [0b5bc1b768] (rid 113971) by nobody on 2004-05-28 18:10:18:
- icomment:
Logged In: NO sorry, i couldn't logged in i tried this command but not foumd any error in it as it printing "Nan"
- login: "nobody"
- mimetype: "text/plain"
- username: "nobody"
- icomment:
Ticket change [0bc4da66e7] (rid 114049) by ferrieux on 2004-05-28 18:30:37:
- icomment:
Logged In: YES user_id=496139 Look at the header: I tried this on 8.3.5. So please give the [info patchlevel] where you no longer have the bug. I'd like to know the critical version where this was fixed. Any idea, frome those who know expr's changelog by heart ? -Alex
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [a8cade835e] (rid 99050) by dkf on 2004-05-28 20:04:20:
- icomment:
Logged In: YES user_id=79902 8.4 had a bit of work in this area, but it turns out that many platform libc's aren't good here. :^(
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [450bd205fe] (rid 116813) by dkf on 2004-05-30 19:34:33:
- closedate changed to: "2004-05-30T12:34:33"
- closer changed to: "dkf"
- icomment:
Logged In: YES user_id=79902 The expr.n manual page states that: "If an operand does not have one of the integer formats given above, then it is treated as a floating-point number if that is possible." Thus, [expr] is correct to regard "Nan" as a float, and is at least not vastly wrong in regarding that as a domain error (because that's what generates NaN values normally.) 8.4 should be a bit better at handling this.
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Out of Date"
- status changed to: "Closed"
- username: "dkf"