almost_equal Interface

public interface almost_equal

Check equality between single or double precision numbers

Calls

interface~~almost_equal~~CallsGraph interface~almost_equal almost_equal proc~almost_equal_double almost_equal_double interface~almost_equal->proc~almost_equal_double proc~almost_equal_single almost_equal_single interface~almost_equal->proc~almost_equal_single proc~get_stdout get_stdout proc~almost_equal_double->proc~get_stdout proc~almost_equal_single->proc~get_stdout

Module Procedures

public function almost_equal_single(a, b, rtol, atol) result(res)

Checks whether (a-b) / max(a,eps) within tolerance

Arguments

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

values to be compared

real(kind=SP), intent(in) :: b

values to be compared

real(kind=SP) :: rtol

relative tolerance

real(kind=SP) :: atol

minumum value for normalisation (~absolute tolerance for rtol=0)

Return Value logical

public function almost_equal_double(a, b, rtol, atol) result(res)

Checks whether (a-b) / max(a,eps) within tolerance

Arguments

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

values to be compared

real(kind=DP), intent(in) :: b

values to be compared

real(kind=DP) :: rtol

relative tolerance

real(kind=DP) :: atol

minumum value for normalisation (~absolute tolerance for rtol=0)

Return Value logical