On this page
math.gamma
Prev: math.fsum | Up: math | Next: math.gcd
Rel: math.acos, math.acosh, math.asin, math.asinh
Ref: docs.python.org — math.gamma
Tags: #public #python3 #stdlib #math
Import
import math
from math import gamma
Signature & Overview
math.gamma(x, /)
Gamma function at x.
Usage
import math
assert math.isclose(math.gamma(5.0), 24.0) # (5 - 1)! = 24
Gotchas
- Undefined at zero and negative integers: Raises
ValueErrorat0, -1, -2, ...; usemath.lgamma(x)for largexto avoid overflow.
REPL Inspect
from math import gamma
help(gamma)
Linked from
Related notes
- tuts/python3/stdlib_module/math/fsum Linked here; links to this page; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/gcd Linked here; links to this page; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/math/acos Linked here; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/acosh Linked here; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/asin Linked here; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/asinh Linked here; shared tags: #math, #stdlib
- tuts/c/stdlib/math shared tags: #math, #stdlib
- tuts/c/stdlib/math/fabs shared tags: #math, #stdlib
- tuts/c/stdlib/math/floor shared tags: #math, #stdlib