Function factorial #

计算一个值的阶乘

Factorial 仅支持整数值作为参数。对于矩阵,该函数将逐元素进行计算。

Syntax #

math.factorial(n)

Parameters #

Parameter Type Description
n number | BigNumber | Array | Matrix 一个整数

Returns #

Type Description
number | BigNumber | Array | Matrix n 的阶乘

Throws #

Type | Description —- | ———–

Examples #

math.factorial(5)    // returns 120
math.factorial(3)    // returns 6

另请参阅 #

combinations, combinationsWithRep, gamma, permutations

Fork me on GitHub