6 lines
146 B
Text
6 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' )
|