Fac
fac
returns the factorial of an integer value.
fac(INTEGER_EXPR)
INTEGER_EXPR
is an expression returning an integer value.0 <= INTEGER_EXPR
<= 58 VALUE=fac(6) : # returns 720SIXTEEN = fac(16) / fac(15)ARRANGEMENT = fac(N) / (fac(P) * fac(N-P))
fac(N)
returns N(N-1)(N-2)* ... 21
By convention, fac(0)
equals 1.
The type of result is Integer or Decimal depending on whether the result is greater or smaller than 2^31-1.
Error code | Description |
---|---|
10 | The argument is not numeric. |
13 | Calculation overflow (x is too big, greater than 58). |
58 | The argument is not an integer. |