Version 12 of abs

Updated 2011-06-29 18:18:51 by AMG

abs is one of several extended math commands available in Tclx. It makes the expr abs function available as a command, and takes expressions as arguments. (Tcl 8.5 has its own copy that it puts in the ::tcl::mathfunc namespace.)

If you don't have that, it can easily be emulated:

 proc abs x {expr {abs($x)}}

AMG: In Tcl 8.4.7, expr {abs(-0.0)} returns -0.0. In Tcl 8.6b1, it returns 0.0. This is on an Intel Xeon platform running CentOS 4.2 (RedHat).


See also: