9.152 ISNAN — Test for a NaN
- Description:
ISNANtests whether a floating-point value is an IEEE Not-a-Number (NaN).- Standard:
-
GNU extension
- Class:
-
Elemental function
- Syntax:
-
ISNAN(X) - Arguments:
-
X Variable of the type REAL. - Return value:
-
Returns a default-kind
LOGICAL. The returned value isTRUEif X is a NaN andFALSEotherwise. - 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
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-6.4.0/gfortran/ISNAN.html