glance/examples/fact.hs

5 lines
68 B
Haskell
Raw Normal View History

2016-05-29 07:49:48 +03:00
factorial x =
if x == 0
then 1
else x * factorial (x - 1)