RosettaCodeData/Task/Factorial/Phix/factorial-1.phix

9 lines
141 B
Text
Raw Permalink Normal View History

2016-12-05 23:44:36 +01:00
global function factorial(integer n)
atom res = 1
while n>1 do
res *= n
n -= 1
end while
return res
end function