# FACT function

## Description

Factorial function. FACT(n) returns the factorial of n. The factorial of a number n, *n*!, is equal to 1*2*3*...*n.

$$ n! = \prod_{k=1}^n k $$

If the argument n is not an integer, it is trunctated.

The argument n cannot be negative.

If n is larger than 170, the function overflows and returns an error (consider using the GammaLn function for calculations).

The argument n can be a real number or a matrix. When it is a matrix, the function returns a matrix with the same dimensions and with the FACT function applied to all elements.

## Example

FACT(5) equals 120 (=1*2*3*4*5)