is_inf Interface

public interface is_inf

Determines if the value of the input variable is Infinity.

Syntax

 n = is_inf(f)

Where:

  • f: Real number to check if it is Infinity.

It returns True if the number is Infinity and False otherwise.

Example

The following program checks some real numbers to see if they are Infinity:

 PROGRAM is_infExample
    USE FU_Numbers, ONLY: is_inf
    IMPLICIT NONE
    REAL :: f
    WRITE(*,*) is_inf(5.)
    f = 0.
    WRITE(*,*) is_inf(1./f)
    WRITE(*,*) is_inf(f/f)
 END PROGRAM is_infExample

Contents


Module Procedures

private elemental function is_inf_sp(val) result(res)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: val

Value to analize. It can have any rank and dimension

Return Value logical

True if the variable is Inf. False otherwise. It will have the same rank and dimension as the input value.

private elemental function is_inf_dp(val) result(res)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: val

Value to analize. It can have any rank and dimension

Return Value logical

True if the variable is Inf. False otherwise. It will have the same rank and dimension as the input value.

private elemental function is_inf_qp(val) result(res)

Arguments

Type IntentOptional Attributes Name
real(kind=qp), intent(in) :: val

Value to analize. It can have any rank and dimension

Return Value logical

True if the variable is Inf. False otherwise. It will have the same rank and dimension as the input value.