Math Functions

math.lgamma()

Compute the natural logarithm of the absolute gamma function without first forming the possibly overflowing gamma value.

Formal Syntax & Structure

python syntaxpython
math.lgamma(x, /)

Parameters & Attributes

NameTypeDescription
xreal numberInput real value.

Return Value

float

Floating-point result; finite precision and domain restrictions apply.

Working Example

Example Snippetpython
import mathprint(round(math.lgamma(5), 6))
Python Reference