Next: factors() Up: Mathematical Macros Help File Previous: economize()   Contents

factorial()

Usage:
factorial(x), x REAL



Keywords: special functions, integers
factorial(x) computes x! (x factorial), where x is a REAL scalar,
vector, matrix or array.  The result is the same size and shape as
as x.  If any element is MISSING, <= -1 or such that x! is too large
to be computed, the corresponding element of the result is MISSING.

Elements of x need not be integers.  x! is computed as exp(lgamma(x+1)),
except that if x is an integer <= 20 the value should be exact.

See also binom() and lgamma().


Gary Oehlert 2003-01-15