Browse Source

Math: make type traits aware of long double.

pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
ee5f8766af
  1. 13
      src/Math/MathTypeTraits.h

13
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<double>: Implementation::MathTypeTraitsFloating
inline constexpr static double epsilon() { return DOUBLE_EQUALITY_PRECISION; }
};
template<> struct MathTypeTraits<long double>: Implementation::MathTypeTraitsFloatingPoint<long double> {
typedef long double FloatingPointType;
inline constexpr static long double epsilon() { return LONG_DOUBLE_EQUALITY_PRECISION; }
};
#endif
}}

Loading…
Cancel
Save