tcl::mathfunc isinfTcl 9.1 only
Gives 1 when a number is infinite.
tcl::mathfunc::isinf NUMBER
expr {isinf(NUMBER)}
Description
Gives 1 when NUMBER as a double is Inf or -Inf. 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 {isinf(-Inf)}
1
% expr {isinf(1)}
0
% expr {isinf(2**2000)}
1
Errors
% expr {isinf("x")}
expected number but got "x"
-errorcode TCL VALUE NUMBER
% expr {isinf()}
not enough arguments for math function "isinf"
-errorcode TCL WRONGARGS
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 only.
- Since
- ztcl 1.0.0-beta.1