2
0
Эх сурвалжийг харах

Fixed factorial implementation

Christophe Riccio 14 жил өмнө
parent
commit
4be7a9bbaa
1 өөрчлөгдсөн 3 нэмэгдсэн , 2 устгасан
  1. 3 2
      glm/gtx/integer.inl

+ 3 - 2
glm/gtx/integer.inl

@@ -49,9 +49,10 @@ namespace integer
 	template <typename genType>
     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;
     }