Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 72bdee3642e990f0eb942d397aefe1f16ccb1213
Ticket: 1275043fffffffffffffffffffffffffffffffff
expr round(0.5) returns no more 1
User & Date: kennykb on 2005-08-29 23:46:29
Changes

  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"