if ( x == x ) then print *, 'x is not a NaN' else print *, 'x is a NaN' endif