From 91b8ae9c6ec3f2925fe206f395cb87dab1261a43 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 16 Sep 2011 09:44:06 +0100 Subject: [PATCH] Fixed round function --- glm/core/func_common.inl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/glm/core/func_common.inl b/glm/core/func_common.inl index 2fac53b7..4695bdff 100644 --- a/glm/core/func_common.inl +++ b/glm/core/func_common.inl @@ -225,7 +225,9 @@ namespace glm { GLM_STATIC_ASSERT(detail::type::is_float, "'round' only accept floating-point inputs"); - return genType(int(x + genType(0.5))); + if(x < 0) + return genType(int(x - genType(0.5))); + return genType(int(x + genType(0.5))); } template