#include <catch_matchers_floating.h>
Definition at line 3057 of file catch.hpp.
◆ WithinUlpsMatcher() [1/2]
Catch::Matchers::Floating::WithinUlpsMatcher::WithinUlpsMatcher |
( |
double | target, |
|
|
int | ulps, |
|
|
FloatingPointKind | baseType ) |
Definition at line 100 of file catch_matchers_floating.cpp.
101 :m_target{ target }, m_ulps{ ulps }, m_type{ baseType } {
102 CATCH_ENFORCE(ulps >= 0,
"Invalid ULP setting: " << ulps <<
'.'
103 << " ULPs have to be non-negative.");
104 }
#define CATCH_ENFORCE(condition, msg)
◆ WithinUlpsMatcher() [2/2]
Catch::Matchers::Floating::WithinUlpsMatcher::WithinUlpsMatcher |
( |
double | target, |
|
|
int | ulps, |
|
|
FloatingPointKind | baseType ) |
◆ describe() [1/2]
std::string Catch::Matchers::Floating::WithinUlpsMatcher::describe |
( |
| ) |
const |
|
overridevirtual |
◆ describe() [2/2]
std::string Catch::Matchers::Floating::WithinUlpsMatcher::describe |
( |
| ) |
const |
|
overridevirtual |
◆ match() [1/2]
bool Catch::Matchers::Floating::WithinUlpsMatcher::match |
( |
double const & | matchee | ) |
const |
|
override |
Definition at line 112 of file catch_matchers_floating.cpp.
112 {
113 switch (m_type) {
115 return almostEqualUlps<float>(static_cast<float>(matchee), static_cast<float>(m_target), m_ulps);
117 return almostEqualUlps<double>(matchee, m_target, m_ulps);
118 default:
120 }
121 }
#define CATCH_INTERNAL_ERROR(msg)
◆ match() [2/2]
bool Catch::Matchers::Floating::WithinUlpsMatcher::match |
( |
double const & | matchee | ) |
const |
|
override |
The documentation for this struct was generated from the following files: