mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 12:41:54 +00:00
Fixed factorial implementation
This commit is contained in:
parent
04d9f92688
commit
4be7a9bbaa
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user