# Factorial: factorial !

### 5.6.1 Factorial: factorial !

The factorial command computes the factorial of a number.
The postfix operator ! is equivalent.

- factorial takes one argument:
  n, an integer.
- factorial(n) returns n!.

#### Example.

Input:

factorial(10)

or:

10!

Output:

3628800

The Γ function (see Section 5.8.13) can be used to extend the factorial function to complex numbers. The Γ function is defined for all complex numbers except for zero and the negative integers, and it satisfies Γ(n+1)=n! for all non-negative integers n. So the factorial can be extended to all complex numbers except the negative integers by n!=Γ(n+1).

#### Examples.

- Input:
  factorial(1/2)
  Output:

  √

  π

  2

- Input:
  factorial(i)
  Output:

  0.5−0.2 i