basic_float_math Module


Uses


Contents


Interfaces

public interface operator(.isclose.)

  • private elemental function isclose_for_operator_real_dp(a, b) result(res)

    Operator functions may only have two arguments.

    Arguments

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

    Return Value logical

  • private elemental function isclose_for_operator_real_sp(a, b) result(res)

    Operator functions may only have two arguments.

    Arguments

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

    Return Value logical

  • private elemental function isclose_for_operator_complex_dp(a, b) result(res)

    Operator functions may only have two arguments.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=dp), intent(in) :: a
    complex(kind=dp), intent(in) :: b

    Return Value logical

  • private elemental function isclose_for_operator_complex_sp(a, b) result(res)

    Operator functions may only have two arguments.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=sp), intent(in) :: a
    complex(kind=sp), intent(in) :: b

    Return Value logical

public interface isclose

  • private elemental function isclose_real_dp(a, b, atol, rtol) result(res)

    @brief Compare floating point numbers for equality

    @details The comparison is symmetric and decorrelates atol and rtol. A good discussion can be found here https://github.com/numpy/numpy/issues/10161

    @param[in] a @param[in] b @param[in] atol The absolute tolerance. Defaults to 0. @param[in] rtol The relative tolerance. Defaults to 1e-9.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: a
    real(kind=dp), intent(in) :: b
    real(kind=dp), intent(in), optional :: atol
    real(kind=dp), intent(in), optional :: rtol

    Return Value logical

  • private elemental function isclose_real_sp(a, b, atol, rtol) result(res)

    @brief Compare floating point numbers for equality

    @details The comparison is symmetric and decorrelates atol and rtol. A good discussion can be found here https://github.com/numpy/numpy/issues/10161

    @param[in] a @param[in] b @param[in] atol The absolute tolerance. Defaults to 0. @param[in] rtol The relative tolerance. Defaults to 1e-9.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: a
    real(kind=sp), intent(in) :: b
    real(kind=dp), intent(in), optional :: atol
    real(kind=dp), intent(in), optional :: rtol

    Return Value logical

  • private elemental function isclose_complex_dp(a, b, atol, rtol) result(res)

    @brief Compare floating point numbers for equality

    @details The comparison is symmetric and decorrelates atol and rtol. A good discussion can be found here https://github.com/numpy/numpy/issues/10161

    @param[in] a @param[in] b @param[in] atol The absolute tolerance. Defaults to 0. @param[in] rtol The relative tolerance. Defaults to 1e-9.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=dp), intent(in) :: a
    complex(kind=dp), intent(in) :: b
    real(kind=dp), intent(in), optional :: atol
    real(kind=dp), intent(in), optional :: rtol

    Return Value logical

  • private elemental function isclose_complex_sp(a, b, atol, rtol) result(res)

    @brief Compare floating point numbers for equality

    @details The comparison is symmetric and decorrelates atol and rtol. A good discussion can be found here https://github.com/numpy/numpy/issues/10161

    @param[in] a @param[in] b @param[in] atol The absolute tolerance. Defaults to 0. @param[in] rtol The relative tolerance. Defaults to 1e-9.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=sp), intent(in) :: a
    complex(kind=sp), intent(in) :: b
    real(kind=dp), intent(in), optional :: atol
    real(kind=dp), intent(in), optional :: rtol

    Return Value logical

public interface near_zero

  • private elemental function near_zero_real_dp(x, epsilon) result(res)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x
    real(kind=dp), intent(in), optional :: epsilon

    Return Value logical

  • private elemental function near_zero_real_sp(x, epsilon) result(res)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x
    real(kind=dp), intent(in), optional :: epsilon

    Return Value logical

  • private elemental function near_zero_complex_dp(x, epsilon) result(res)

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=dp), intent(in) :: x
    real(kind=dp), intent(in), optional :: epsilon

    Return Value logical

  • private elemental function near_zero_complex_sp(x, epsilon) result(res)

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=sp), intent(in) :: x
    real(kind=dp), intent(in), optional :: epsilon

    Return Value logical

public interface conjgt

  • private elemental function conjgt_real_dp(x) result(res)

    Arguments

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

    Return Value real(kind=dp)

  • private elemental function conjgt_real_sp(x) result(res)

    Arguments

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

    Return Value real(kind=sp)

  • private elemental function conjgt_complex_dp(x) result(res)

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=dp), intent(in) :: x

    Return Value complex(kind=dp)

  • private elemental function conjgt_complex_sp(x) result(res)

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=sp), intent(in) :: x

    Return Value complex(kind=sp)


Functions

private elemental function isclose_real_dp(a, b, atol, rtol) result(res)

@brief Compare floating point numbers for equality

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: a
real(kind=dp), intent(in) :: b
real(kind=dp), intent(in), optional :: atol
real(kind=dp), intent(in), optional :: rtol

Return Value logical

private elemental function isclose_for_operator_real_dp(a, b) result(res)

Operator functions may only have two arguments.

Arguments

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

Return Value logical

private elemental function near_zero_real_dp(x, epsilon) result(res)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: x
real(kind=dp), intent(in), optional :: epsilon

Return Value logical

private elemental function isclose_real_sp(a, b, atol, rtol) result(res)

@brief Compare floating point numbers for equality

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: a
real(kind=sp), intent(in) :: b
real(kind=dp), intent(in), optional :: atol
real(kind=dp), intent(in), optional :: rtol

Return Value logical

private elemental function isclose_for_operator_real_sp(a, b) result(res)

Operator functions may only have two arguments.

Arguments

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

Return Value logical

private elemental function near_zero_real_sp(x, epsilon) result(res)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: x
real(kind=dp), intent(in), optional :: epsilon

Return Value logical

private elemental function isclose_complex_dp(a, b, atol, rtol) result(res)

@brief Compare floating point numbers for equality

Read more…

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: a
complex(kind=dp), intent(in) :: b
real(kind=dp), intent(in), optional :: atol
real(kind=dp), intent(in), optional :: rtol

Return Value logical

private elemental function isclose_for_operator_complex_dp(a, b) result(res)

Operator functions may only have two arguments.

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: a
complex(kind=dp), intent(in) :: b

Return Value logical

private elemental function near_zero_complex_dp(x, epsilon) result(res)

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: x
real(kind=dp), intent(in), optional :: epsilon

Return Value logical

private elemental function isclose_complex_sp(a, b, atol, rtol) result(res)

@brief Compare floating point numbers for equality

Read more…

Arguments

Type IntentOptional Attributes Name
complex(kind=sp), intent(in) :: a
complex(kind=sp), intent(in) :: b
real(kind=dp), intent(in), optional :: atol
real(kind=dp), intent(in), optional :: rtol

Return Value logical

private elemental function isclose_for_operator_complex_sp(a, b) result(res)

Operator functions may only have two arguments.

Arguments

Type IntentOptional Attributes Name
complex(kind=sp), intent(in) :: a
complex(kind=sp), intent(in) :: b

Return Value logical

private elemental function near_zero_complex_sp(x, epsilon) result(res)

Arguments

Type IntentOptional Attributes Name
complex(kind=sp), intent(in) :: x
real(kind=dp), intent(in), optional :: epsilon

Return Value logical

private elemental function conjgt_real_dp(x) result(res)

Arguments

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

Return Value real(kind=dp)

private elemental function conjgt_real_sp(x) result(res)

Arguments

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

Return Value real(kind=sp)

private elemental function conjgt_complex_dp(x) result(res)

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: x

Return Value complex(kind=dp)

private elemental function conjgt_complex_sp(x) result(res)

Arguments

Type IntentOptional Attributes Name
complex(kind=sp), intent(in) :: x

Return Value complex(kind=sp)

public pure function get_nan()

Arguments

None

Return Value real(kind=dp)

public elemental function is_nan(r)

Arguments

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

Return Value logical