beetlebug▾
/

tcl::mathfunc issubnormalTcl 9.1 only

Gives 1 when a number is a subnormal float.

tcl::mathfunc::issubnormal NUMBER
expr {issubnormal(NUMBER)}

Description

Gives 1 when NUMBER as a double is not zero and smaller in magnitude than the smallest normal double, about 2.2e-308.

Arguments

ArgumentTypeDefaultDescription
NUMBERnumberrequiredAn integer of any size, a float, or NaN.

Returns

1 or 0.

Examples

% expr {issubnormal(1e-310)}
1

% expr {issubnormal(1.0)}
0

% expr {issubnormal(0)}
0

Errors

% expr {issubnormal("x")}
expected number but got "x"
-errorcode TCL VALUE NUMBER

% expr {issubnormal()}
not enough arguments for math function "issubnormal"
-errorcode TCL WRONGARGS

Facts

Capability
None.
Tcl release
Tcl 9.1 only.
Since
ztcl 1.0.0-beta.1

See also