Test if a double precision is a finite number
FT 11.02.2022
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
double precision, | intent(in) | :: | x |
PURE FUNCTION is_finite_number( x ) RESULT( res )
!***********************************************
!
!# Test if a double precision is a finite number
!
! FT 11.02.2022
!
!***********************************************
USE, INTRINSIC:: IEEE_ARITHMETIC, ONLY: IEEE_IS_FINITE
DOUBLE PRECISION, INTENT(IN):: x
LOGICAL:: res
res= (.NOT.ISNAN(x)) .AND. IEEE_IS_FINITE(x)
END FUNCTION is_finite_number