tcl::mathfunc dimTcl 9.1 only
Gives the positive difference of two numbers.
tcl::mathfunc::dim X Y
expr {dim(X, Y)}
Description
Gives X minus Y when X is greater than Y, and 0.0 otherwise. It is fdim of C.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| X | number | required | The first number. |
| Y | number | required | The number to subtract. |
Returns
A float, 0 or more.
Examples
% expr {dim(5, 3)}
2.0
% expr {dim(3, 5)}
0.0
Errors
% expr {dim(5)}
not enough arguments for math function "dim"
-errorcode TCL WRONGARGS
% expr {dim(NaN, 1)}
floating point value is Not a Number
-errorcode TCL VALUE DOUBLE NAN
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 only.
- Since
- ztcl 1.0.0-beta.1