diff --git a/src/Utilities/MathUtil.f90 b/src/Utilities/MathUtil.f90 index 2240e3e5c93..b91795eacc6 100644 --- a/src/Utilities/MathUtil.f90 +++ b/src/Utilities/MathUtil.f90 @@ -7,49 +7,10 @@ module MathUtilModule implicit none private - public :: is_same public :: is_close contains - !> @brief Check if a real value is approximately equal to another. - logical function is_same(a, b, eps) - ! -- dummy - real(DP), intent(in) :: a !< first real - real(DP), intent(in) :: b !< second real - real(DP), intent(in), optional :: eps !< relative tolerance (default=DSAME) - ! -- local - real(DP) :: epsloc - real(DP) :: denom - real(DP) :: rdiff - - ! -- evaluate optional arguments - if (present(eps)) then - epsloc = eps - else - epsloc = DSAME - end if - - ! -- determine approximate equality - is_same = .false. - if (a == b) then - is_same = .true. - else - if (abs(b) > abs(a)) then - denom = b - else - denom = a - if (abs(denom) == DZERO) then - denom = DPREC - end if - end if - rdiff = abs((a - b) / denom) - if (rdiff <= epsloc) then - is_same = .true. - end if - end if - end function is_same - !> @brief Check if a real value is approximately equal to another. !! !! By default the determination is symmetric in a and b, as in