Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0c1ebe7dabbf211138f92fc8fedaa95354a3041c395f306e127ed630b39a87bc
Ticket: bd71dd33055d27d7fc8f075412359822195c3cd9
round() function with precision argument rounding away from zero
User & Date: anonymous on 2025-11-27 09:15:36
Changes

  1. icomment:
    Yes this subject is a wide one ...
    For a general purpose langage, the lack of the most common rounding method of fp numbers is a surprise (compared to the range of mathematical functions offered, on the other hand, in ::tcl::mathfunc).
    I share your point of vue : a new design should provide sufficient flexibility to maximize its usefullness.
    However, I'm not sure about the effective need of other methods than "away from zero" or "toward zero" (in Tcl/Tk projects).
    A possible supplemental argument in favour of a function against a command is that with a sole suplementary precision argument to the existing round() function, some flexibility can be obtained in giving the choice between two methods based on the positive or negative sign of the precision argument (a way wich seems not too counter intuitive to me, convenient, but yes something unusal)
    
    Thenk you
    Jean-Marie
    
  2. login: "anonymous"
  3. mimetype: "text/plain"