FACT Function

Computes a factorial.

Category: Mathematical

Syntax

FACT(n)

Required Argument

n

is a numeric constant, variable, or expression.

Details

The mathematical representation of the FACT function is given by the following equation:
F A C T ( n ) = n !
with n ≥ 0.
If the expression cannot be computed, a missing value is returned. For moderately large values, it is sometimes not possible to compute the FACT function.

Example

The following SAS statement produces this result.
SAS Statement
Result
x=fact(5);
120