| 5980 | } |
| 5981 | |
| 5982 | bool Approx::equalityComparisonImpl(const double other) const { |
| 5983 | // First try with fixed margin, then compute margin based on epsilon, scale and Approx's value |
| 5984 | // Thanks to Richard Harris for his help refining the scaled margin value |
| 5985 | return marginComparison(m_value, other, m_margin) || marginComparison(m_value, other, m_epsilon * (m_scale + std::fabs(m_value))); |
| 5986 | } |
| 5987 | |
| 5988 | void Approx::setMargin(double newMargin) { |
| 5989 | CATCH_ENFORCE(newMargin >= 0, |
no test coverage detected