#4000 ::math::min returning false minimum

obsolete: 8.5.1
closed-invalid
69. Other (102)
5
2008-05-14
2008-05-14
Anonymous
No

Versions:
Tcl/Tk: ActiveTcl 8.5.1.0
Math-Package: 1.2.4
OS: Windows XP Professional Version 2002 SP2

The procedure '::math::min' returns a false minimum when an argument is not a number and starts with '-' or '+'.

Sample Code:
package require math
::math::min 1 2 -abc

The sample code above will return '-abc' instead of '1'.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    ::math::min is part of tcllib, not tcl.
    It uses "<" for comparison and thus gets string
    comparison for non-numeric values.

    In 8.5 tcl got ::tcl::mathfunc::min which is purely numeric

     
  • Donal K. Fellows

    • labels: --> 69. Other
    • milestone: --> obsolete: 8.5.1
    • assigned_to: nobody --> dkf
    • status: open --> closed-invalid
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks