Version 3 of min

Updated 2007-11-01 12:54:42 by LV

In Tcl 8.5, the expr command has a variadic min() function.

 % expr min(5,1,4,2,3)
 1

 % expr min(5,1.1,-17.345,1e10)
 -17.345

All arguments to the min must be able to be interpreted as numeric. Otherwise, you get this sort of error:

 % expr min(5,7,1,-6,a,19)
 invalid bareword "a"
 in expression "min(5,7,1,-6,a,19)";
 should be "$a" or "{a}" or "a(...)" or ...