Built-in functions: float_nan()

The function float_nan() returns a special floating point value called Not a Number (NAN).

Declaration

float float_nan()

Discussion

The function float_nan() returns a special constant value which represents an invalid floating point operand. Such value can result from mathematical operations performed with incorrect arguments like the calculation of square root with a negative value. The value returned by the float_nan() function can be used to initialize variables.

var float v1 = float_nan(); // v1 = NAN var bool b1 = v1.isnan; // b1 = true

See also the float instant property isnan.