From a55c60bb19c0681f74f1abb6b607a555f44e4af5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 19 Nov 2018 11:33:49 +0100 Subject: [PATCH] Math: publicly mention what TypeTraits::equals() is based on. --- src/Magnum/Math/TypeTraits.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Math/TypeTraits.h b/src/Magnum/Math/TypeTraits.h index e34883318..ed74eb150 100644 --- a/src/Magnum/Math/TypeTraits.h +++ b/src/Magnum/Math/TypeTraits.h @@ -133,7 +133,8 @@ template struct TypeTraits: Implementation::TypeTraitsDefault { * @brief Fuzzy compare * * Uses fuzzy compare for floating-point types (using @ref epsilon() - * value), pure equality comparison everywhere else. + * value), pure equality comparison everywhere else. Algorithm adapted from + * http://floating-point-gui.de/errors/comparison/. */ static bool equals(T a, T b); @@ -222,7 +223,6 @@ template struct TypeTraitsFloatingPoint: TypeTraitsName { static bool equalsZero(T a, T epsilon); }; -/* Adapted from http://floating-point-gui.de/errors/comparison/ */ template bool TypeTraitsFloatingPoint::equals(const T a, const T b) { /* Shortcut for binary equality (also infinites) */ if(a == b) return true;