Artifacts Associated With Ticket 1273713fffffffff
Ticket change [0542bcb848] (rid 89026) by alvinpleung on 2005-08-26 00:38:28:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
set factor2 [expr ($x0x1 - $y1_sqrt_factor1) * $denominator] [expr acos($factor2)] works set factor2 [expr acos(($x0x1 - $y1_sqrt_factor1) * $denominator)] failed with error message domain error: argument not in valid range
- foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "alvinpleung"
- subsystem initialized to: "16. Commands A-H"
- title initialized to: "Expr with acos"
- type initialized to: "Bug"
Add attachment "bug.tcl" [87daec93ef] (rid 131772) by alvinpleung on 2005-08-26 07:38:28.
Ticket change [a9cf89710b] (rid 99215) by alvinpleung on 2005-08-26 07:38:29:
- icomment:
File Added - 147014: bug.tcl
- login: "alvinpleung"
- mimetype: "text/plain"
- username: "alvinpleung"
- icomment:
Ticket change [d461568450] (rid 123432) by msofer on 2005-08-26 08:13:32:
- icomment:
Logged In: YES user_id=148712 Can you provide a complete session log, including the values of your variables? Are you sure that they have the same values in both cases? The error message indicates that (Tcl thinks that) the argument to 'acos' is not between -1 and 1 % set a 2 2 % set b 1 1 % set c 0.5 0.5 % set f [expr acos(($a-$b)*$c)] 1.0471975512 % set c 2 2 % set f [expr acos(($a-$b)*$c)] domain error: argument not in valid range
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [de7b2d127f] (rid 114857) by dkf on 2005-08-26 15:46:48:
- icomment:
Logged In: YES user_id=79902 Sounds as if your code is working at very close to the boundary values, which is usually problematic. FWIW, when I'm working out angles, I try to atan2() which has far fewer annoying cases than the rest of the inverse trig functions.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [092b7e8f01] (rid 89673) by alvinpleung on 2005-08-27 00:33:00:
- icomment:
Logged In: YES user_id=958624 I already attached the complete test case in the original bug report. It is currently shown in the "Attached Files" section with description "test case." The problem case is when ($a - $b) * $c eval to 1.0. I will attach the test case again.
- login: "alvinpleung"
- mimetype: "text/plain"
- username: "alvinpleung"
- icomment:
Ticket change [f2105a92c8] (rid 109472) by alvinpleung on 2005-08-27 00:33:01:
- icomment:
File Added - 147105: bug.tcl
- login: "alvinpleung"
- mimetype: "text/plain"
- username: "alvinpleung"
- icomment:
Add attachment "bug.tcl" [a4743159b4] (rid 110209) by alvinpleung on 2005-08-27 00:33:01.
Ticket change [59ef054a6a] (rid 118054) by msofer on 2005-08-27 00:58:58:
- assignee changed to: "msofer"
- closedate changed to: "2005-08-26T17:58:58"
- closer changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 Oops - sorry, had not seen the attached file. I did take a look at the new "Full test case" (it is missing a paren in line 51, but this is irrelevant for this bug report) The problem is caused by the fact that your expressions in line 50 and 51 are not {}'quoted. This causes the values of the variables to be re-read from their string representation, with some loss in precision if tcl_precision is less than 17 (it is 12 by default). This is not really a bug. So there are two possible fixes (and I recommend using both): (1) do {}'quote your expressions: it is much faster, it does not produce these effects, and is almost always the right thing to do. There are few cases where you may want two substitution rounds (one by the tcl interpreter, one by the [expr]) interpreter). If that is what you're after, it will be clear to you. (2) do 'set ::tcl_precision 17' when working with doubles (but see http://www.tcl.tk/man/tcl8.4/TclCmd/tclvars.htm#M39 for some gotchas) - login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Pending"
- username: "msofer"
Ticket change [c4c6de017c] (rid 111892) by dkf on 2005-08-28 00:51:18:
- foundin changed to: "obsolete: 8.4.11"
- icomment:
Logged In: YES user_id=79902 Note for people reading this in the future: in 8.5, the right thing to do will be to leave tcl_precision set to its default value. The advice on setting it to 17 is only correct up to 8.4 (or rather some version from the alpha cycle of 8.5, but that's an internal matter).
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
Ticket change [e778401a4d] (rid 104459) by sf-robot on 2005-09-11 09:20:10:
- closedate changed to: "2005-09-11T02:20:10"
- closer changed to: "sf-robot"
- icomment:
Logged In: YES user_id=1312539 This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker).
- login: "sf-robot"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "sf-robot"