Fac

fac returns the factorial of an integer value.

Syntax

 fac(INTEGER_EXPR)

Examples

 VALUE=fac(6) : # returns 720SIXTEEN = fac(16) / fac(15)ARRANGEMENT = fac(N) / (fac(P) * fac(N-P))

Description

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 codeDescription
10The argument is not numeric.
13Calculation overflow (x is too big, greater than 58).
58The argument is not an integer.

See also

cnp, anp.