Browse Source

Fixed trunc implementation

Christophe Riccio 15 years ago
parent
commit
2268a23bf3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      glm/core/func_common.inl

+ 1 - 1
glm/core/func_common.inl

@@ -189,7 +189,7 @@ namespace glm
     inline genType trunc(genType const & x)
     inline genType trunc(genType const & x)
     {
     {
 		GLM_STATIC_ASSERT(detail::type<genType>::is_float);
 		GLM_STATIC_ASSERT(detail::type<genType>::is_float);
-        return floor(abs(x));
+        return x < 0 ? -floor(-x) : floor(x);;
     }
     }
 
 
     template <typename valType>
     template <typename valType>