mirror of
https://github.com/g-truc/glm.git
synced 2025-04-07 06:25:00 +00:00
Fixed factorial implementation
This commit is contained in:
parent
04d9f92688
commit
4be7a9bbaa
1 changed files with 3 additions and 2 deletions
|
@ -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…
Add table
Reference in a new issue