NAN Constant (Pseudo-constant)

math.h, timath.h

A constant defining an undefined value.

NAN is an acronyme of "Not a Number". TIOS generates NAN when nothing can be deduced about the magnitude of the result (for example, when dividing zero by zero, or when substracting two infinities of the same sign). Also, TIOS generates NAN when the argument of a function is out of legal range, excluding values of the argument which produces infinity results. For example, log will produce NAN when the argument is negative, but when the argument is zero, the result is NEGATIVE_INF.

NAN also belongs to the class of "transfinite" numbers (see is_transfinite). Use is_nan to check whether a value is NAN. This is a common method to check in run time whether the arguments of the called math functions was legal.


See also: UNSIGNED_INF