RosettaCodeData/Task/Factorial/Icon/factorial-1.icon

6 lines
133 B
Text
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
procedure factorial(n)
n := integer(n) | runerr(101, n)
if n < 0 then fail
return if n = 0 then 1 else n*factorial(n-1)
end