RosettaCodeData/Task/Factorial/FunL/factorial-2.funl
2016-12-05 23:44:36 +01:00

5 lines
146 B
Text

def
factorial( (0|1) ) = 1
factorial( n )
| n > 0 = n*factorial( n - 1 )
| otherwise = error( 'factorial: n should be non-negative' )