Function lgamma #

Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.

Syntax #

math.lgamma(n)

Parameters #

Parameter Type Description
n number | Complex A real or complex number

Returns #

Type Description
number | Complex The log gamma of 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

See also #

gamma

Fork me on GitHub