This is the answer.
Based on such, I have a sample function to detect a +Inf:
function ispinf(x)
! function to detect if x is +Inf
integer :: ispinf
double precision :: x
!local variables
integer :: IPInf
real :: PInf
data IPInf/B'01111111100000000000000000000000'/ ! +Infinity
PInf = transfer(IPinf,Pinf)
if (x.eq.PInf) then
ispinf = 1
else
ispinf = 0
endif
end function ispinf
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment