Math Functions

math.gamma()

Evaluate the gamma function, which extends factorial through Gamma(n)=(n-1)! for positive integers. Nonpositive integer poles are outside its finite domain.

Formal Syntax & Structure

python syntaxpython
math.gamma(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(math.gamma(5))
Python Reference