Facebook Page Twitter Page LinkedIn Page
× Python Tutorial Python Advanced Python Resources Python Libraries


The Python math.lgamma() function is used to return the natural logarithm of the absolute value of the gamma function of the argument.

Syntax

math.lgamma(x)   

Parameters

x Required. Specify the value.

Return Value

Returns the natural logarithm of the absolute value of the gamma function of the argument.

Example:

The below example shows the usage of lgamma() function.

import math

print(math.lgamma(0.1))
print(math.lgamma(1.5))
print(math.lgamma(2.5))
print(math.lgamma(-1.5))
print(math.lgamma(-2.5))

The output of the above code will be:

2.2527126517342055
-0.12078223763524543
0.2846828704729196
0.8600470153764812
-0.05624371649767457

❮ Python Math Module