]>
Commit | Line | Data |
---|---|---|
c63539ff ML |
1 | .. |
2 | Copyright 1988-2022 Free Software Foundation, Inc. | |
3 | This is part of the GCC manual. | |
4 | For copying conditions, see the copyright.rst file. | |
5 | ||
6 | .. _isnan: | |
7 | ||
8 | ISNAN --- Test for a NaN | |
9 | ************************ | |
10 | ||
11 | .. index:: ISNAN, IEEE, ISNAN | |
12 | ||
13 | .. function:: ISNAN(X) | |
14 | ||
15 | ``ISNAN`` tests whether a floating-point value is an IEEE | |
16 | Not-a-Number (NaN). | |
17 | ||
18 | :param X: | |
19 | Variable of the type ``REAL``. | |
20 | ||
21 | :return: | |
22 | Returns a default-kind ``LOGICAL``. The returned value is ``TRUE`` | |
23 | if :samp:`{X}` is a NaN and ``FALSE`` otherwise. | |
24 | ||
25 | Standard: | |
26 | GNU extension | |
27 | ||
28 | Class: | |
29 | Elemental function | |
30 | ||
31 | Syntax: | |
32 | .. code-block:: fortran | |
33 | ||
34 | ISNAN(X) | |
35 | ||
36 | Example: | |
37 | .. code-block:: fortran | |
38 | ||
39 | program test_nan | |
40 | implicit none | |
41 | real :: x | |
42 | x = -1.0 | |
43 | x = sqrt(x) | |
44 | if (isnan(x)) stop '"x" is a NaN' | |
3ed1b4ce | 45 | end program test_nan |