diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index 1a00ff50..9c55c7a1 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -151,22 +151,15 @@ namespace detail } // sign - //Try something like based on x >> 31 to get the sign bit + // fast and works for any type template GLM_FUNC_QUALIFIER genFIType sign(genFIType x) { GLM_STATIC_ASSERT( std::numeric_limits::is_iec559 || (std::numeric_limits::is_signed && std::numeric_limits::is_integer), "'sign' only accept signed inputs"); - - genFIType result; - if(x > genFIType(0)) - result = genFIType(1); - else if(x < genFIType(0)) - result = genFIType(-1); - else - result = genFIType(0); - return result; + + return genFIType(genFIType(0) < x) - (x < genFIType(0)); } template class vecType> diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index fa8d3e34..a18d823f 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -213,8 +213,8 @@ namespace glm T zFar ) { - assert(aspect != static_cast(0)); - assert(zFar != zNear); + assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); + assert(zFar > zNear); T const tanHalfFovy = tan(fovy / static_cast(2)); diff --git a/readme.txt b/readme.txt index e21020b6..3f65b863 100644 --- a/readme.txt +++ b/readme.txt @@ -84,6 +84,7 @@ Fixes: - Fixed implicit conversion from another tvec2 type to another tvec2 #241 - Fixed lack of consistency of quat and dualquat constructors - Fixed uaddCarray #253 +- Fixed float comparison warnings #270 Deprecation: - Removed degrees for function parameters