6#ifndef TESTTOOLS_FLOATASSERT_H
7#define TESTTOOLS_FLOATASSERT_H
18 return fabs(lhs-rhs)<=FLT_EPSILON;
22 return fabs(lhs-rhs)>FLT_EPSILON;
26 bool isEqual (
double x1,
double x2,
double thresh = 1e-6)
28 double den = std::abs(x1+x2);
29 if (den < thresh)
return true;
30 double diff = std::abs (x1-x2) / den;
33 std::cout <<
"Match failure: " << x1 <<
" " << x2 <<
" (" <<
diff <<
")\n";
39#define FLOAT_NEQassert( LHS, RHS ) assert(Athena_test::floatNEQ(LHS, RHS));
40#define FLOAT_EQassert( LHS, RHS ) assert(Athena_test::floatEQ(LHS, RHS));
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
functions & macros to test the difference between floats
bool floatEQ(float lhs, float rhs)
bool floatNEQ(float lhs, float rhs)
bool isEqual(double x1, double x2, double thresh=1e-6)