From 4be7a9bbaa111f4a0e59f123bf7dad0627e1f4e6 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 26 May 2011 15:00:06 +0100 Subject: [PATCH] Fixed factorial implementation --- glm/gtx/integer.inl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; }