isclose Interface

public interface isclose

Evaluates the closeness between two real or complex variables.


Module Procedures

private pure function isclose_real(a, b, rel_tol, abs_tol)

Evaluates the closeness between two real variables.

.true. if a and b are close to each other according to a tolerance, and .false. otherwise. Tolerance is defined by rel_tol and abs_tol, where abs_tol is used for comparing values close no zero.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: a
real(kind=wp), intent(in) :: b
real(kind=wp), intent(in), optional :: rel_tol

Relative tolerance, default=tol_wp

real(kind=wp), intent(in), optional :: abs_tol

Absolute tolerace, default=tol_wp

Return Value logical

private pure function isclose_complex(a, b, rel_tol, abs_tol)

Evaluates the closeness between two complex variables.

.true. if a and b are close to each other according to a tolerance, and .false. otherwise. Tolerance is defined by rel_tol and abs_tol, where abs_tol is used for comparing values close no zero.

Arguments

Type IntentOptional Attributes Name
complex(kind=wp), intent(in) :: a
complex(kind=wp), intent(in) :: b
real(kind=wp), intent(in), optional :: rel_tol

Relative tolerance, default=tol_wp

real(kind=wp), intent(in), optional :: abs_tol

Absolute tolerace, default=tol_wp

Return Value logical