# Factorial (factorial)

Factorial: n! is the product of the whole numbers from 1 to n.

## How to write it

### factorial(n)

**n**

A whole number, zero or more. Takes a whole number.

## Examples

- $\displaystyle 5! = 120$

  `factorial(5)`

  In the solver, `factorial(5)` gives `120`.

  [Open in the solver](https://hilberon.com/?q=factorial%285%29)

## Related functions

- [double_factorial](https://hilberon.com/library/double_factorial)

  Double factorial: n!! multiplies every second number down from n.
- [floor](https://hilberon.com/library/floor)

  Greatest whole number not above a number.
- [exp](https://hilberon.com/library/exp)

  Exponential function; exp(x) is the power e^x.
- [frac](https://hilberon.com/library/frac)

  Fractional part of a number.
- [gcd](https://hilberon.com/library/gcd)

  Greatest common divisor of whole numbers.
- [divide](https://hilberon.com/library/divide)

  A quotient: the function form of /.

---
Source: https://hilberon.com/library/factorial
