Browse Source

Math: minor cleanup.

pull/87/head
Vladimír Vondruš 12 years ago
parent
commit
3b76862f69
  1. 4
      src/Magnum/Math/TypeTraits.h

4
src/Magnum/Math/TypeTraits.h

@ -161,7 +161,7 @@ template<class T> struct TypeTraitsFloatingPoint {
/* Adapted from http://floating-point-gui.de/errors/comparison/ */
template<class T> bool TypeTraitsFloatingPoint<T>::equals(const T a, const T b) {
/* Shortcut for binary equality (also infinites) */
if (a == b) return true;
if(a == b) return true;
const T absA = std::abs(a);
const T absB = std::abs(b);
@ -169,7 +169,7 @@ template<class T> bool TypeTraitsFloatingPoint<T>::equals(const T a, const T b)
/* One of the numbers is zero or both are extremely close to it, relative
error is meaningless */
if (a == T{} || b == T{} || difference < TypeTraits<T>::epsilon())
if(a == T{} || b == T{} || difference < TypeTraits<T>::epsilon())
return difference < TypeTraits<T>::epsilon();
/* Relative error */

Loading…
Cancel
Save