tcl::mathfunc isfiniteTcl 9.1 only
Gives 1 when a number is finite.
tcl::mathfunc::isfinite NUMBER
expr {isfinite(NUMBER)}
Description
Gives 1 when NUMBER as a double is neither infinite nor NaN. An integer too large for a double counts as infinite.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| NUMBER | number | required | An integer of any size, a float, or NaN. |
Returns
1 or 0.
Examples
% expr {isfinite(1.5)}
1
% expr {isfinite(Inf)}
0
% expr {isfinite(2**2000)}
0
Errors
% expr {isfinite("x")}
expected number but got "x"
-errorcode TCL VALUE NUMBER
% expr {isfinite()}
not enough arguments for math function "isfinite"
-errorcode TCL WRONGARGS
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 only.
- Since
- ztcl 1.0.0-beta.1