Make Approx::margin inclusive

Fixes #952, related to #980
This commit is contained in:
Martin Hořeňovský committed 2017-10-30 21:33:29 +01:00
1 parent 06586b7180
commit a6cf19abff
6 files changed
+131 -9

No files matched your search

+3 -2
View File
@@ -57,7 +57,8 @@ namespace Detail {
if (relativeOK) {
return true;
}
return std::fabs(lhs_v - rhs.m_value) < rhs.m_margin;
return std::fabs(lhs_v - rhs.m_value) <= rhs.m_margin;
}
template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
@@ -130,7 +131,7 @@ namespace Detail {
if (relativeOK) {
return true;
}
return std::fabs(lhs - rhs.m_value) < rhs.m_margin;
return std::fabs(lhs - rhs.m_value) <= rhs.m_margin;
}
friend bool operator == ( Approx const& lhs, double rhs ) {