Hey guys,
I was in the middle of writing a code until I realised that I needed to use factorials (x!) to carry out a calculation. I noticed that the Wiki didn't help much. Does anyone know how to use factorials in Lua?
If you're unsure by what I mean with "factorial", it is a mathematical operation where x is continuously multiplied by x-1 until x=1
Example:
(4! = 4 x 3 x 2 x 1 = 24) and (5! = 5 x 4! = 5 x 24 = 120 (or 5 x 4 x 3 x 2 x 1))

2 comments
Lua functions are slooowwwwww. Use with caution!
Not tail recursive! B+. /s