Factorials

### 12.1.1 Factorials

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

- factorial takes n, an integer.
- factorial(n) returns n!.
- The Γ function (see Section 7.3.13) is 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

factorial(10)

or:

10!

3628800 |  |  |  |  |  |  |  |  |  |

factorial(1/2)

√ |
π
2

factorial(i)

0.5−0.2 i |  |  |  |  |  |  |  |  |  |