Function factorial

Compute the factorial of a value

Factorial only supports an integer value as argument. For matrices, the function is evaluated element wise.

Syntax

factorial(n)

Parameters

Parameter Type Description
n number | BigNumber | Array | Matrix An integer number

Returns

Type Description
number | BigNumber | Array | Matrix The factorial of n

Examples

factorial(5);    // returns 120
factorial(3);    // returns 6

See also

combinations, gamma, permutations