函数 lgamma #
实数、正数和复数的伽马函数的对数,对数字使用 Lanczos 近似,对复数使用 Stirling 级数。
Syntax #
math.lgamma(n)
Parameters #
| Parameter | Type | Description |
|---|---|---|
n |
number | Complex | 实数或复数 |
Returns #
| Type | Description |
|---|---|
| number | Complex | n 的对数伽马值 |
Throws #
Type | Description —- | ———–
Examples #
math.lgamma(5) // returns 3.178053830347945
math.lgamma(0) // returns Infinity
math.lgamma(-0.5) // returns NaN
math.lgamma(math.i) // returns -0.6509231993018536 - 1.8724366472624294i