Skip to content
Tcl Source Code History Of Ticket 1275043
Login

History Of Ticket 1275043

Artifacts Associated With Ticket 1275043

  1. Ticket change [68693be7f4] (rid 103064) by sarnold75 on 2005-08-28 08:58:31:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      --- Environment ---
      WindowsME and Tcl 8.5a4 built with MingW
      
      --- Example of code ---
      With Tcl8.4 (and even 8.5a3) :
      
      expr round(0.5) --> 1
      expr round(-0.5) --> -1
      
      With the new 8.5a4 :
      
      expr round(0.5) --> 0
      expr round(-0.5) --> 0
      
      --- Discussion ---
      I have been told that now the new functionality is to
      round to even numbers.
      
      The reason for this bug report is that the tcllib's
      math::bigfloat package
      used to test the bigfloat round command against the builtin
      [expr round()].
      It does no more, because I hand-coded the attempted result 
      as 1 or -1.
      
      But I would like to know at least one example where the
      round
      function we are used to causes a bug. Then, I could want to
      implement the same behavior in my package.
      
      
    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: "sarnold75"
    9. subsystem initialized to: "16. Commands A-H"
    10. title initialized to: "expr round(0.5) returns no more 1"
    11. type initialized to: "Bug"
  2. Ticket change [b2007dde63] (rid 98262) by dkf on 2005-08-28 18:52:31:

    1. assignee changed to: "dgp"
  3. Ticket change [81520ceb69] (rid 117010) by dkf on 2005-08-28 18:52:45:

    1. foundin changed to: "obsolete: 8.5a4"
  4. Ticket change [4f9835c3eb] (rid 125853) by dgp on 2005-08-28 21:32:19:

    1. assignee changed to: "kennykb"
  5. Ticket change [72bdee3642] (rid 100913) by kennykb on 2005-08-29 23:46:29:

    1. closedate changed to: "2005-08-29T16:46:29"
    2. closer changed to: "kennykb"
    3. foundin changed to: "obsolete: 8.4.11"
    4. icomment:
      Logged In: YES 
      user_id=99768
      
      Thank you for this report.
      
      You are right that a gratuitous change of the
      semantics to "round to even" should be avoided
      (perhaps a "nearbyint" function should be supplied
      to give those semantics).
      
      In addition to your reported error, while designing
      the test cases for this problem, I discovered that
      expr round(0.49999999999999994) gave 1.0 in 8.4.
      This last is surely a bug (and applies to any number
      whose fractional part differed from 0.5 by 1/2 ulp).
      I added a test case for that problem as well, and
      backported the whole mess to 8.4 as well.
      
      
    5. login: "kennykb"
    6. mimetype: "text/plain"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"
    9. username: "kennykb"