ISNAN — Test for a NaN¶
- ISNAN()¶
ISNANtests whether a floating-point value is an IEEE Not-a-Number (NaN).- Parameters
X – Variable of the type
REAL.- Returns
Returns a default-kind
LOGICAL. The returned value isTRUEifXis a NaN andFALSEotherwise.
Standard:GNU extension
Class:Elemental function
Syntax:ISNAN(X)
Example:program test_nan implicit none real :: x x = -1.0 x = sqrt(x) if (isnan(x)) stop '"x" is a NaN' end program test_nan