ISNAN (The GNU Fortran Compiler)

### 8.168 `ISNAN` — Test for a NaN ¶

Synopsis:

  `ISNAN(X)`

Description:

  `ISNAN` tests whether a floating-point value is an IEEE Not-a-Number (NaN).

Class:

  Elemental function

Arguments:

  X | Variable of the type `REAL`.

Return value:

  Returns a default-kind `LOGICAL`. The returned value is `TRUE` if X is a NaN and `FALSE` otherwise.

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

Standard:

  GNU extension