From ee5f8766af944355b7e3b43c59aa9454f9ff49b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 16 Jan 2013 21:53:14 +0100 Subject: [PATCH] Math: make type traits aware of long double. --- src/Math/MathTypeTraits.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 }}