is_close Interface

public interface is_close

Test two floating-point values for approximate equality.

Returns .true. when abs(a - b) <= max(rtol*max(abs(a), abs(b)), atol). The relative tolerance rtol defaults to sqrt(epsilon) for the working kind and the absolute tolerance atol defaults to 0; both are optional. Supported kinds are real(sp) and real(dp). Usage: flag = is_close(a, b [, rtol] [, atol])

Calls

interface~~is_close~~CallsGraph interface~is_close is_close proc~is_close_dp is_close_dp interface~is_close->proc~is_close_dp proc~is_close_sp is_close_sp interface~is_close->proc~is_close_sp

Module Procedures

private elemental function is_close_sp(a, b, rtol, atol) result(flag)

Approximate equality for real(sp) values.

Arguments

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

Return Value logical

private elemental function is_close_dp(a, b, rtol, atol) result(flag)

Approximate equality for real(dp) values.

Arguments

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

Return Value logical