phaser/v3/src/math/Factorial.js

19 lines
212 B
JavaScript
Raw Normal View History

var Factorial = function (value)
{
if (value === 0)
{
return 1;
}
var res = value;
while (--value)
{
res *= value;
}
return res;
};
module.exports = Factorial;