diff --git a/src/Utilities/MathUtil.f90 b/src/Utilities/MathUtil.f90 index 029743a36eb..f01d6f7e39c 100644 --- a/src/Utilities/MathUtil.f90 +++ b/src/Utilities/MathUtil.f90 @@ -119,7 +119,10 @@ logical function is_close(a, b, rtol, atol, symmetric) logical(LGP) :: lsymmetric ! check for exact equality - if (a == b) is_close = .true. + if (a == b) then + is_close = .true. + return + end if ! process optional arguments if (.not. present(rtol)) then @@ -138,7 +141,6 @@ logical function is_close(a, b, rtol, atol, symmetric) lsymmetric = symmetric end if - ! approximate equality if (lsymmetric) then ! "weak" symmetric test, https://peps.python.org/pep-0485/#which-symmetric-test is_close = abs(a - b) <= max(lrtol * max(abs(a), abs(b)), latol)