Fixed and test round functions

This commit is contained in:
Christophe Riccio
2011-09-16 09:39:51 +01:00
parent 20816a9f94
commit 7cd97fe610
2 changed files with 70 additions and 4 deletions

View File

@@ -237,6 +237,8 @@ namespace detail
{
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'round' only accept floating-point inputs");
if(x < 0)
return genType(int(x - genType(0.5)));
return genType(int(x + genType(0.5)));
}