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