RosettaCodeData/Task/Factorial/FunL/factorial-2.funl
2023-07-01 13:44:08 -04: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' )