RosettaCodeData/Task/Factorial/FunL/factorial-4.funl

4 lines
111 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
def factorial( n )
| n >= 0 = product( 1..n )
| otherwise = error( 'factorial: n should be non-negative' )