diff --git a/glm/gtx/integer.inl b/glm/gtx/integer.inl index aef659e0..e9c93c0f 100644 --- a/glm/gtx/integer.inl +++ b/glm/gtx/integer.inl @@ -49,9 +49,10 @@ namespace integer template GLM_FUNC_QUALIFIER genType factorial(genType const & x) { + genType Temp = x; genType Result; - for(Result = 1; x > 1; --x) - Result *= x; + for(Result = 1; Temp > 1; --Temp) + Result *= Temp; return Result; }