Fix bug in WithinAbs::match() and add tests for it
This commit is contained in:
1 parent
6c99b04c87
commit
8b78087412
7 files changed
+138
-8
No files matched your search
@@ -88,7 +88,7 @@ namespace Floating {
|
||||
// Performs equivalent check of std::fabs(lhs - rhs) <= margin
|
||||
// But without the subtraction to allow for INFINITY in comparison
|
||||
bool WithinAbsMatcher::match(double const& matchee) const {
|
||||
return (matchee + m_margin >= m_target) && (m_target + m_margin >= m_margin);
|
||||
return (matchee + m_margin >= m_target) && (m_target + m_margin >= matchee);
|
||||
}
|
||||
|
||||
std::string WithinAbsMatcher::describe() const {
|
||||
|
||||
Reference in new issue
Block a user