Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

How to check NaN

ekeom
Novice
1,225 Views
Dear all,

How can I check if a variable contain NaN (Not a number). I would like to write something like :

if(a.eq.NaN) then

Do something special

endif

Best regards,

Didace
0 Kudos
1 Reply
TimP
Honored Contributor III
1,225 Views
This has been discussed at more length previously on these forums. Current ifort supports both the legacy (non-standard) ISNAN() function and the standard ieee_is_nan().
0 Kudos
Reply