util::max (public)

 util::max [ args... ]

Defined in packages/acs-tcl/tcl/utilities-procs.tcl

Returns the maximum of a list of numbers. Example: max 2 3 1.5 returns 3. Since Tcl8.5, numerical min and max are among the math functions supported by expr. The reason why this proc is still around is that it supports also non-numerical values in the list, in a way that is not so easily replaceable by a lsort idiom (but could).

Author:
Lars Pind <lars@pinds.com>
Created:
31 August 2000
See Also:
  • expr
  • lsort

Partial Call Graph (max 5 caller/called nodes):
%3 test_min_max min_max (test acs-tcl) util::max util::max test_min_max->util::max

Testcases:
min_max
Source code:
    set max [lindex $args 0]
    foreach arg $args {
        if { $arg > $max } {
            set max $arg
        }
    }
    return $max
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/utilities-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: