Skip to content
Snippets Groups Projects
Commit b6ddd1cb authored by Christian Engwer's avatar Christian Engwer
Browse files

[test] use different epsilon for int and float types

This avoids compiler warning about implicitly rounded to zero
parent 033d0919
No related branches found
No related tags found
No related merge requests found
......@@ -210,13 +210,25 @@ struct ScalarOrderingTest
}
};
template<typename T>
struct Epsilon
{
static T value() { return T(1e-6); }
};
template<>
struct Epsilon<int>
{
static int value() { return 0; }
};
// scalar ordering doesn't work for complex numbers
template <class rt, int d>
struct DotProductTest
{
DotProductTest() {
typedef std::complex<rt> ct;
const rt myEps(1e-6);
const rt myEps = Epsilon<rt>::value();
static_assert(
( Dune::is_same< typename Dune::FieldTraits<rt>::real_type, rt>::value ),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment