Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 68693be7f433bc1f1dfe4fc6e0d9ac17c363c21e
Ticket: 1275043fffffffffffffffffffffffffffffffff
expr round(0.5) returns no more 1
User & Date: sarnold75 on 2005-08-28 08:58:31
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed 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 changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "sarnold75"
  9. subsystem changed to: "16. Commands A-H"
  10. title changed to: "expr round(0.5) returns no more 1"
  11. type changed to: "Bug"