diff --git a/src/Math/MathTypeTraits.h b/src/Math/MathTypeTraits.h index 385fc8a0e..4ef7c2a4d 100644 --- a/src/Math/MathTypeTraits.h +++ b/src/Math/MathTypeTraits.h @@ -32,6 +32,14 @@ #define DOUBLE_EQUALITY_PRECISION 1.0e-12 #endif +/** +@brief Precision when testing long doubles for equality +@todo some proper value please +*/ +#ifndef LONG_DOUBLE_EQUALITY_PRECISION +#define LONG_DOUBLE_EQUALITY_PRECISION 1.0e-18 +#endif + namespace Magnum { namespace Math { /** @@ -152,6 +160,11 @@ template<> struct MathTypeTraits: Implementation::MathTypeTraitsFloating inline constexpr static double epsilon() { return DOUBLE_EQUALITY_PRECISION; } }; +template<> struct MathTypeTraits: Implementation::MathTypeTraitsFloatingPoint { + typedef long double FloatingPointType; + + inline constexpr static long double epsilon() { return LONG_DOUBLE_EQUALITY_PRECISION; } +}; #endif }}