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

Method WithinUlpsMatcher

unittests/catch.hpp:7976–7981  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7974 }
7975
7976 WithinUlpsMatcher::WithinUlpsMatcher(double target, int ulps, FloatingPointKind baseType)
7977 :m_target{ target }, m_ulps{ ulps }, m_type{ baseType } {
7978 if (m_ulps < 0) {
7979 throw std::domain_error("Allowed ulp difference has to be >= 0");
7980 }
7981 }
7982
7983 bool WithinUlpsMatcher::match(double const& matchee) const {
7984 switch (m_type) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected