Case 1
- Number n
- 5
120
Open with these valuesChange any value to update the result.
120
Factorial: 120Your current valid inputs, with one value varied across the range.
| Number n | Factorial |
|---|---|
| 4 | 24 |
| 5Your value | 120 |
| 6 | 720 |
n! multiplies every whole number from 1 up to n, so 5! is 1 × 2 × 3 × 4 × 5 = 120. It counts the orderings of n different things: five runners can finish in 120 ways. By definition 0! is 1.
120
Open with these values3,628,800
Open with these values2,432,902,008,176,640,000
Open with these valuesn! = 1 × 2 × 3 × … × n
| n | Reads as | n! |
|---|---|---|
| 0 | the empty arrangement | 1 |
| 1 | one item, one order | 1 |
| 5 | 1 × 2 × 3 × 4 × 5 | 120 |
| 10 | orderings of ten items | 3628800 |
| 13 | past six billion | 6227020800 |
| 20 | past two quintillion | 2432902008176640000 |
| 21 | last value this formatter prints exactly | 51090942171709440000 |
A factorial is the product of every positive whole number up to n, written n!, so five factorial is 1 × 2 × 3 × 4 × 5 = 120. It counts the ways to arrange n distinct items in order, which is why it turns up throughout probability, combinations and permutations.
There is exactly one way to arrange an empty set — the empty arrangement — so the count is 1, not 0. It also keeps the formulas consistent: the recurrence that turns n factorial into n × (n − 1) factorial makes one factorial equal 1 × zero factorial, which only works out if zero factorial is 1.
The number of distinct ways to put n different items in a row. Three books have six possible shelf orders, five runners have 120 possible finishing orders.
Faster than any exponential. Five factorial is only 120, but ten factorial is already 3,628,800 and twenty factorial is over 2.4 quintillion. Each step multiplies by the next integer, so the value explodes.
The factorial of 18 is the last within JavaScript's safe-integer range, but those of 19 through 22 are still individually exact binary64 values. This calculator stops at 21 because its current Number formatter rounds the printed tail of the factorial of 22, even though that value is exact internally. At 23, the Number value itself differs from the true integer.
Diese Seite gibt es auch auf Deutsch.
Zu Deutsch wechseln