Fixed factorial implementation

This commit is contained in:
Christophe Riccio 2011-05-26 15:00:06 +01:00
parent 04d9f92688
commit 4be7a9bbaa

View File

@ -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;
}