Skip to content
Tcl Source Code History Of Ticket 1273713
Login

History Of Ticket 1273713

Artifacts Associated With Ticket 1273713

  1. Ticket change [0542bcb848] (rid 89026) by alvinpleung on 2005-08-26 00:38:28:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. 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
      
      
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "alvinpleung"
    9. subsystem initialized to: "16. Commands A-H"
    10. title initialized to: "Expr with acos"
    11. type initialized to: "Bug"
  2. Add attachment "bug.tcl" [87daec93ef] (rid 131772) by alvinpleung on 2005-08-26 07:38:28.

  3. Ticket change [a9cf89710b] (rid 99215) by alvinpleung on 2005-08-26 07:38:29:

    1. icomment:
      
      
      File Added - 147014: bug.tcl
      
      
      
    2. login: "alvinpleung"
    3. mimetype: "text/plain"
    4. username: "alvinpleung"
  4. Ticket change [d461568450] (rid 123432) by msofer on 2005-08-26 08:13:32:

    1. 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
      
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  5. Ticket change [de7b2d127f] (rid 114857) by dkf on 2005-08-26 15:46:48:

    1. 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.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  6. Ticket change [092b7e8f01] (rid 89673) by alvinpleung on 2005-08-27 00:33:00:

    1. 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.
      
      
    2. login: "alvinpleung"
    3. mimetype: "text/plain"
    4. username: "alvinpleung"
  7. Ticket change [f2105a92c8] (rid 109472) by alvinpleung on 2005-08-27 00:33:01:

    1. icomment:
      
      
      File Added - 147105: bug.tcl
      
      
      
    2. login: "alvinpleung"
    3. mimetype: "text/plain"
    4. username: "alvinpleung"
  8. Add attachment "bug.tcl" [a4743159b4] (rid 110209) by alvinpleung on 2005-08-27 00:33:01.

  9. Ticket change [59ef054a6a] (rid 118054) by msofer on 2005-08-27 00:58:58:

    1. assignee changed to: "msofer"
    2. closedate changed to: "2005-08-26T17:58:58"
    3. closer changed to: "msofer"
    4. 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)
      
      
      
    5. login: "msofer"
    6. mimetype: "text/plain"
    7. resolution changed to: "Invalid"
    8. status changed to: "Pending"
    9. username: "msofer"
  10. Ticket change [c4c6de017c] (rid 111892) by dkf on 2005-08-28 00:51:18:

    1. foundin changed to: "obsolete: 8.4.11"
    2. 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).
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. username: "dkf"
  11. Ticket change [e778401a4d] (rid 104459) by sf-robot on 2005-09-11 09:20:10:

    1. closedate changed to: "2005-09-11T02:20:10"
    2. closer changed to: "sf-robot"
    3. 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).
      
      
    4. login: "sf-robot"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "sf-robot"