|
NAMEfpclassify - Floating point number classification of Tcl values SYNOPSISpackage require tcl 9.0 fpclassify value DESCRIPTIONThe fpclassify command takes a floating point number, value, and returns one of the following strings that describe it:
The fpclassify command throws an error if value is not a floating-point value and cannot be converted to one. EXAMPLEThis shows how to check whether the result of a computation is numerically safe or not. (Note however that it does not guard against numerical errors; just against representational problems.)
set value [command-that-computes-a-value]
switch [fpclassify $value] {
SEE ALSOexpr(n), mathfunc(n) KEYWORDSfloating point STANDARDSThis command depends on the fpclassify() C macro conforming to “ISO C99” (i.e., to ISO/IEC 9899:1999). COPYRIGHTCopyright © 2018 Kevin B. Kenny <kennykb@acm.org>. All rights reserved
|