tcl::mathfunc isnanTcl 9.1 only
Gives 1 when a number is NaN.
tcl::mathfunc::isnan NUMBER
expr {isnan(NUMBER)}
Description
Gives 1 when NUMBER is NaN, the float that is not a number, and 0 for each other number.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| NUMBER | number | required | An integer of any size, a float, or NaN. |
Returns
1 or 0.
Examples
% expr {isnan(NaN)}
1
% expr {isnan(1)}
0
Errors
% expr {isnan("x")}
expected number but got "x"
-errorcode TCL VALUE NUMBER
% expr {isnan()}
not enough arguments for math function "isnan"
-errorcode TCL WRONGARGS
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 only.
- Since
- ztcl 1.0.0-beta.1