7 lines
185 B
Text
7 lines
185 B
Text
fp.fact = ($n) -> {
|
|
if($n < 0) {
|
|
throw fn.withErrorMessage($LANG_ERROR_INVALID_ARGUMENTS, n must be >= 0)
|
|
}
|
|
|
|
return fn.arrayReduce(fn.arrayGenerateFrom(fn.inc, $n), 1L, fn.mul)
|
|
}
|