50 template<typename dtype, enable_if_t<std::is_integral<dtype>::value,
int> = 0>
53 return inValue1 == inValue2;
65 template<typename dtype, enable_if_t<std::is_floating_point<dtype>::value,
int> = 0>
68 const auto absValue1 =
std::abs(inValue1);
69 const auto absValue2 =
std::abs(inValue2);
70 return std::abs(inValue1 - inValue2) <=
71 ((absValue1 > absValue2 ? absValue2 : absValue1) *
std::abs(inEpsilon));
82 template<typename dtype, enable_if_t<std::is_integral<dtype>::value,
int> = 0>
83 bool essentiallyEqual(
const std::complex<dtype>& inValue1,
const std::complex<dtype>& inValue2) noexcept
85 return inValue1 == inValue2;
97 template<typename dtype, enable_if_t<std::is_floating_point<dtype>::value,
int> = 0>
99 const std::complex<dtype>& inValue2,
100 const std::complex<dtype>& inEpsilon) noexcept
102 const auto absValue1 =
std::abs(inValue1);
103 const auto absValue2 =
std::abs(inValue2);
104 return std::abs(inValue1 - inValue2) <=
105 ((absValue1 > absValue2 ? absValue2 : absValue1) *
std::abs(inEpsilon));
116 template<typename dtype, enable_if_t<std::is_floating_point<dtype>::value,
int> = 0>
130 template<typename dtype, enable_if_t<std::is_floating_point<dtype>::value,
int> = 0>
131 bool essentiallyEqual(
const std::complex<dtype>& inValue1,
const std::complex<dtype>& inValue2) noexcept
133 return essentiallyEqual(inValue1, inValue2, DtypeInfo<std::complex<dtype>>::epsilon());
Holds info about the dtype.
Definition: DtypeInfo.hpp:41
bool essentiallyEqual(dtype inValue1, dtype inValue2) noexcept
Definition: essentiallyEqual.hpp:51
Definition: Coordinate.hpp:45
auto abs(dtype inValue) noexcept
Definition: abs.hpp:49