From fc53581c68c56642c00409f220601f11f41bd233 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 20 Aug 2017 16:53:50 +0200 Subject: [PATCH] Fixed Better follow GLSL min and max specification #372 --- glm/detail/func_common.inl | 4 ++-- readme.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index 59b97aa82..23f441936 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -15,7 +15,7 @@ namespace glm GLM_FUNC_QUALIFIER genType min(genType x, genType y) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point or integer inputs"); - return x < y ? x : y; + return (y < x) ? y : x; } // max @@ -24,7 +24,7 @@ namespace glm { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point or integer inputs"); - return x > y ? x : y; + return (x < y) ? y : x; } // abs diff --git a/readme.md b/readme.md index 4c922a709..26fbb2330 100644 --- a/readme.md +++ b/readme.md @@ -97,6 +97,7 @@ glm::mat4 camera(float Translate, glm::vec2 const& Rotate) - Fixed Visual C++ 2017.2 warning regarding __has_feature definision #655 - Fixed documentation warnings - Fixed GLM_HAS_OPENMP when OpenMP is not enabled +- Fixed Better follow GLSL min and max specification #372 #### Deprecation: - Requires Visual Studio 2013, GCC 4.7, Clang 3.4, Cuda 7, ICC 2013 or a C++11 compiler