UNPKG

854 BMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function factorial
4
5Compute the factorial of a value
6
7Factorial only supports an integer value as argument.
8For matrices, the function is evaluated element wise.
9
10
11## Syntax
12
13```js
14math.factorial(n)
15```
16
17### Parameters
18
19Parameter | Type | Description
20--------- | ---- | -----------
21`n` | number &#124; BigNumber &#124; Array &#124; Matrix | An integer number
22
23### Returns
24
25Type | Description
26---- | -----------
27number &#124; BigNumber &#124; Array &#124; Matrix | The factorial of `n`
28
29
30## Examples
31
32```js
33math.factorial(5) // returns 120
34math.factorial(3) // returns 6
35```
36
37
38## See also
39
40[combinations](combinations.md),
41[combinationsWithRep](combinationsWithRep.md),
42[gamma](gamma.md),
43[permutations](permutations.md)