10 lines
183 B
Text
10 lines
183 B
Text
|
|
fp.fact = ($n) -> {
|
||
|
|
if($n < 0) {
|
||
|
|
throw fn.withErrorMessage($LANG_ERROR_INVALID_ARGUMENTS, n must be >= 0)
|
||
|
|
}elif($n < 2) {
|
||
|
|
return 1L
|
||
|
|
}
|
||
|
|
|
||
|
|
return parser.op($n * fp.fact(-|$n))
|
||
|
|
}
|