Fortran将NaN设置为零

时间:2018-07-09 15:18:17

标签: fortran

有什么方法可以在Fortran90中将NaN(不是数字)设置为零

program testnan
implicit none

real :: x,y
x = -1
y = sqrt(x)
if(y.lt.0)then
y = 0
end if

print*, x, y

end program testnan

我尝试了一些测试,但是找不到解决方案。

0 个答案:

没有答案