Full name
math.lgamma
Library
math
Syntax
math.lgamma(x)
Description
The math.lgamma function returns the natural logarithm of the absolute value of the gamma function at the point x.
This function has the following graph:
Parameters
- x: Number from which to obtain the value of the logarithm of the gamma function.
Result
The math.lgamma function returns a real number.
Examples
We can obtain the logarithm of the gamma function at the point x = 0.5 with the following code:
math.lgamma(0.5)
0.5723649429247004
It is possible to check that the result is the expected one by calculating the logarithm of the gamma function explicitly:
math.log (math.gamma(0.5))
0.5723649429247