enclosed more min/ max in parentheses to default MFC macros

This commit is contained in:
Phil Nash 2017-10-12 16:00:04 +01:00
parent 276393e4e5
commit 2eb93f47f7
4 changed files with 7 additions and 6 deletions

View file

@ -17,7 +17,7 @@
namespace Catch {
namespace Detail {
double max(double lhs, double rhs);
double dmax(double lhs, double rhs);
class Approx {
public:
@ -43,7 +43,8 @@ namespace Detail {
friend bool operator == ( const T& lhs, Approx const& rhs ) {
// Thanks to Richard Harris for his help refining this formula
auto lhs_v = static_cast<double>(lhs);
bool relativeOK = std::fabs(lhs_v - rhs.m_value) < rhs.m_epsilon * (rhs.m_scale + (max)(std::fabs(lhs_v), std::fabs(rhs.m_value)));
bool relativeOK = std::fabs(lhs_v - rhs.m_value) < rhs.m_epsilon * (rhs.m_scale +
dmax(std::fabs(lhs_v), std::fabs(rhs.m_value)));
if (relativeOK) {
return true;
}