函数 gamma #

使用 Lanczos 近似法计算小数值的 gamma 函数,并使用扩展的 Stirling 近似法计算大数值。

为避免与矩阵 Gamma 函数混淆,此函数不适用于矩阵。

Syntax #

math.gamma(n)

Parameters #

Parameter Type Description
n number | BigNumber | Complex 实数或复数

Returns #

Type Description
number | BigNumber | Complex n 的 gamma 值

Throws #

Type | Description —- | ———–

Examples #

math.gamma(5)       // returns 24
math.gamma(-0.5)    // returns -3.5449077018110335
math.gamma(math.i)  // returns -0.15494982830180973 - 0.49801566811835596i

另请参阅 #

combinations, factorial, permutations

Fork me on GitHub