From a063df8336114b0b5b2fd557ee58a49b6e247a7e Mon Sep 17 00:00:00 2001 From: Gottfried Leibniz <37632412+gottfriedleibniz@users.noreply.github.com> Date: Fri, 6 Jan 2023 10:02:09 -0400 Subject: [PATCH] fix: generalize epsilonEqual --- glm/gtc/epsilon.inl | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/glm/gtc/epsilon.inl b/glm/gtc/epsilon.inl index 508b9f89..021e88de 100644 --- a/glm/gtc/epsilon.inl +++ b/glm/gtc/epsilon.inl @@ -6,24 +6,8 @@ namespace glm { - template<> - GLM_FUNC_QUALIFIER bool epsilonEqual - ( - float const& x, - float const& y, - float const& epsilon - ) - { - return abs(x - y) < epsilon; - } - - template<> - GLM_FUNC_QUALIFIER bool epsilonEqual - ( - double const& x, - double const& y, - double const& epsilon - ) + template + GLM_FUNC_QUALIFIER bool epsilonEqual(genType const& x, genType const& y, genType const& epsilon) { return abs(x - y) < epsilon; } @@ -40,14 +24,8 @@ namespace glm return lessThan(abs(x - y), vec(epsilon)); } - template<> - GLM_FUNC_QUALIFIER bool epsilonNotEqual(float const& x, float const& y, float const& epsilon) - { - return abs(x - y) >= epsilon; - } - - template<> - GLM_FUNC_QUALIFIER bool epsilonNotEqual(double const& x, double const& y, double const& epsilon) + template + GLM_FUNC_QUALIFIER bool epsilonNotEqual(genType const& x, genType const& y, genType const& epsilon) { return abs(x - y) >= epsilon; }