Skip to content
Tcl Source Code History Of Ticket 2954959fffffffffffffffffffffffffffffffff
Login

History Of Ticket 2954959fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 2954959fffffffffffffffffffffffffffffffff

  1. Ticket change [84de7b02fe] (rid 117634) by fridolin on 2010-02-19 13:43:08:

    1. assignee initialized to: "dgp"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      % expr abs(0.0)
      -0.0
      
      Tcl version is 8.5.5, but it guess it's also in CVS (core-8-5-branch):
      
      tclBasic.c (abs function)
       7437 if (d <= 0.0) {
       7438     Tcl_SetObjResult(interp, Tcl_NewDoubleObj(-d));
       7439 } else {
       7440     Tcl_SetObjResult(interp, objv[1]);
       7441 }
      
      should be
      
      7437 if (d < 0.0) {
       7438     Tcl_SetObjResult(interp, Tcl_NewDoubleObj(-d));
       7439 } else {
       7440     Tcl_SetObjResult(interp, objv[1]);
       7441 }
      
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "fridolin"
    10. subsystem initialized to: "48. Number Handling"
    11. title initialized to: "expr abs(0.0) is -0.0"
    12. type initialized to: "Bug"
  2. Ticket change [7b4f9b6338] (rid 90496) by nijtmans on 2010-02-19 21:09:45:

    1. icomment:
      Yes, this problem is in head as well.
      
      And the same for TCL_NUMBER_LONG. There
      the "<=" should be "<" as well. The effect is only
      the unnecessary creation of an object, but still.....
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  3. Ticket change [90b5af6ca4] (rid 120497) by dgp on 2010-02-19 22:52:42:

    1. assignee changed to: "nijtmans"
    2. icomment:
      
      Please fix.  Thanks!
      
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. username: "dgp"
  4. Ticket change [d4034beb2f] (rid 123374) by nijtmans on 2010-02-20 06:39:06:

    1. icomment:
      Turns out not that trivial to fix. See: also [Bug 1893815]
      tcl::mathfunc commands and non-canonical string reps
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  5. Ticket change [f09bc8a449] (rid 109218) by nijtmans on 2010-02-21 15:59:05:

    1. icomment:
      Fixed in HEAD, to be backported to 8.5 and 8.4
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  6. Ticket change [7711fb6cb8] (rid 105699) by dkf on 2010-02-21 16:21:14:

    1. foundin changed to: "obsolete: 8.5.5"
    2. priority changed to: "7 High"
    3. resolution changed to: "Fixed"
  7. Ticket change [7309fa5240] (rid 104975) by nijtmans on 2010-02-22 17:45:35:

    1. foundin changed to: "obsolete: 8.5.8"
    2. icomment:
      Added some more tests, just to prove that the TCL_NUMBER_LONG was not quite right either. The problem
      is that in ieee floating point math, -0.0 == 0.0 gives true! This means that you cannot really distinguish
      -0.0 and 0.0 in floating point math.
      
      Looking at the test cases, the rule seems to be:
      - If the input looks negative, take the negative of the output and take that as a result.
      - otherwise, take the unchanged input.
      
      No, what looks negative? For example, -0.0 and -0 look negative, but really are
      not: they are both forms of zero! Still, we want to output resp. 0.0 and 0 in those
      cases. So, we need to distinguish between -0.0 and 0.0 (in the float case) and
      between 0 and -0 (in the long case). How do we do that.
      
      In the float case, we can use memcmp(). In the long case, I see no other way to look
      for ´-´ characters (if there is a string representation). Anyway, this way I could
      make all test cases pass.
      
      For 8.4 the story is a little bit different. The only 'mistake' was that abs(-0.0) returns
      -0.0, which is in fact correct, but not expected regarding the above rules. Numbers
      like 1e-324 result in an underflow immediately in 8.4, it seems not worth to
      fix that. But the abs(-0.0) case still can be fixed, therefore leaving this issue open.
      
      
    3. login: "nijtmans"
    4. mimetype: "text/plain"
    5. username: "nijtmans"
  8. Ticket change [c4ffc3d912] (rid 111919) by dkf on 2010-02-22 21:50:55:

    1. icomment:
      In the 'long' case, if you've got -0 then you're on a ones-complement machine and we no longer guarantee Tcl to work right. :-)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  9. Ticket change [93fe7b7ea7] (rid 105907) by nijtmans on 2010-02-22 22:06:23:

    1. icomment:
      >In the 'long' case, if you've got -0 then you're on a ones-complement
      >machine and we no longer guarantee Tcl to work right. :-)
      
      What happened, is that:
      expr {abs(0x0)}    -->    0
      expr {abs(0x1)}    -->    0x1
      I would at least expect the two answers to
      have the same form.... That's what this fix
      is about in the "long" case
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  10. Ticket change [b7d72bd9b4] (rid 128866) by nijtmans on 2010-02-22 22:10:50:

    1. icomment:
      Oh no, I meant
      ::tcl::mathfunc::abs 0x0  --> 0   (old output)   0x0 (new output)
      ::tcl::mathfunc::abs 0x1  --> 0x1
      That's what this fix is about regarding longs in Tcl 8.5/8.6. In
      Tcl 8.4 there is no ::tcl::mathfunc::abs, so this is no issue.
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  11. Ticket change [d04afddc44] (rid 113153) by nijtmans on 2010-02-23 07:00:21:

    1. closedate changed to: "2010-02-23T00:00:21"
    2. closer changed to: "nijtmans"
    3. icomment:
      
      
      allow_comments - 1
      
      Relevant test cases backported to Tcl 8.4 as well, and minor
      fix applied to tclExecute.c to make them all pass.
      DONE
      
      
    4. login: "nijtmans"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "nijtmans"