mirror of
https://github.com/g-truc/glm.git
synced 2024-11-27 02:34:35 +00:00
Fixed factorial implementation
This commit is contained in:
parent
04d9f92688
commit
4be7a9bbaa
@ -49,9 +49,10 @@ namespace integer
|
|||||||
template <typename genType>
|
template <typename genType>
|
||||||
GLM_FUNC_QUALIFIER genType factorial(genType const & x)
|
GLM_FUNC_QUALIFIER genType factorial(genType const & x)
|
||||||
{
|
{
|
||||||
|
genType Temp = x;
|
||||||
genType Result;
|
genType Result;
|
||||||
for(Result = 1; x > 1; --x)
|
for(Result = 1; Temp > 1; --Temp)
|
||||||
Result *= x;
|
Result *= Temp;
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user