Commit 2242beed authored by Dominik Charousset's avatar Dominik Charousset

Fix comparison of long double in test framework

parent 1080b8e7
......@@ -44,8 +44,8 @@ template <class T, class U,
|| std::is_floating_point<U>::value,
int>::type = 0>
bool equal_to(const T& t, const U& u) {
auto x = static_cast<double>(t);
auto y = static_cast<double>(u);
auto x = static_cast<long double>(t);
auto y = static_cast<long double>(u);
auto max = std::max(std::abs(x), std::abs(y));
auto dif = std::abs(x - y);
return dif <= max * 1e-5;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment