Added assert in inversesqrt to detect division by zero. #61

This commit is contained in:
Christophe Riccio
2013-05-16 14:36:04 +00:00
parent bc9aaa4033
commit b95a53095b
2 changed files with 2 additions and 0 deletions

View File

@@ -146,6 +146,7 @@ namespace _detail
)
{
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'inversesqrt' only accept floating-point input");
assert(x > genType(0));
return genType(1) / ::std::sqrt(x);
}