MCPcopy Create free account
hub / github.com/catchorg/Catch2 / equalityComparisonImpl

Method equalityComparisonImpl

extras/catch_amalgamated.cpp:590–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

588 }
589
590 bool Approx::equalityComparisonImpl(const double other) const {
591 // First try with fixed margin, then compute margin based on epsilon, scale and Approx's value
592 // Thanks to Richard Harris for his help refining the scaled margin value
593 return marginComparison(m_value, other, m_margin)
594 || marginComparison(m_value, other, m_epsilon * (m_scale + std::fabs(std::isinf(m_value)? 0 : m_value)));
595 }
596
597 void Approx::setMargin(double newMargin) {
598 CATCH_ENFORCE(newMargin >= 0,

Callers 1

operator ==Method · 0.45

Calls 1

marginComparisonFunction · 0.70

Tested by

no test coverage detected