Artifacts Associated With Ticket 1275043
Ticket change [68693be7f4] (rid 103064) by sarnold75 on 2005-08-28 08:58:31:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- 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.
- foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "sarnold75"
- subsystem initialized to: "16. Commands A-H"
- title initialized to: "expr round(0.5) returns no more 1"
- type initialized to: "Bug"
Ticket change [b2007dde63] (rid 98262) by dkf on 2005-08-28 18:52:31:
- assignee changed to: "dgp"
Ticket change [81520ceb69] (rid 117010) by dkf on 2005-08-28 18:52:45:
- foundin changed to: "obsolete: 8.5a4"
Ticket change [4f9835c3eb] (rid 125853) by dgp on 2005-08-28 21:32:19:
- assignee changed to: "kennykb"
Ticket change [72bdee3642] (rid 100913) by kennykb on 2005-08-29 23:46:29:
- closedate changed to: "2005-08-29T16:46:29"
- closer changed to: "kennykb"
- foundin changed to: "obsolete: 8.4.11"
- 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.
- login: "kennykb"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "kennykb"