MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / WithinAbsMatcher

Method WithinAbsMatcher

unittests/catch.hpp:7959–7964  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7957namespace Matchers {
7958namespace Floating {
7959 WithinAbsMatcher::WithinAbsMatcher(double target, double margin)
7960 :m_target{ target }, m_margin{ margin } {
7961 if (m_margin < 0) {
7962 throw std::domain_error("Allowed margin difference has to be >= 0");
7963 }
7964 }
7965
7966 // Performs equivalent check of std::fabs(lhs - rhs) <= margin
7967 // But without the subtraction to allow for INFINITY in comparison

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected