|
|||||
function | FP_isnan |
Related Syntax | Other Library Functions |
Library: Floating Point
Include: omfloat.xin |
Returns: Boolean
A value of true when x is NaN; otherwise, returns a value of false. |
define external switch function FP_isnan value float x
A function that tests a float number to determine if it is not a number (NaN), then returns a switch value of true ("x" is NaN) or false. This function provides the only reliable means of determining whether a variable contains a NaN value.
The following "contrived" sample uses FP_isnan
to check for a value that is not a number (NaN). When such a value is found, the message "Error, division by zero." is produced.
. . . set x to FP_v "0" set y to x set result to FP_div (x,y) do when FP_isnan result output "Error, division by zero. %n" halt end
Related Syntax FP_eq FP_lt FP_le FP_gt FP_ge FP_isneg FP_iszero FP_ispos |
Other Library Functions FP_abs FP_acos FP_add FP_asin FP_atan FP_atan2 FP_ceil FP_cos FP_cosh FP_d FP_div FP_eq FP_exp FP_floor FP_ge FP_gt FP_hypot FP_isnan FP_isneg FP_ispos FP_iszero FP_j0 FP_j1 FP_jn FP_le FP_log FP_log10 FP_lt FP_mod FP_mul FP_ne FP_nearest FP_neg FP_pow FP_s FP_sin FP_sinh FP_sqrt FP_sub FP_tan FP_tanh FP_trunc FP_v FP_y0 FP_y1 FP_yn |
---- |