Advertisement

Gamma function calculator

Choose a real or complex input. Supported components satisfy |real part| <= 170 and |imaginary part| <= 100. Poles at non-positive integers are excluded.

Calculator

Real part of Gamma
24.00000000
Imaginary part of Gamma
0.00000000
Real, imaginary (10 significant digits)
24, 0
Magnitude
24.00000000

Advertisement

How this calculator works

Gamma extends factorials beyond positive integers: Gamma(n) = (n - 1)! for positive integer n. This evaluator uses a Lanczos approximation and the reflection identity for the left half-plane. The defining integral converges for positive real part; analytic continuation defines other regular points. Results close to poles can be very sensitive to input rounding.

Formula

Gamma(z) = integral from 0 to infinity of t^(z-1) exp(-t) dt for Re(z) > 0. Gamma(z)Gamma(1-z) = pi/sin(pi z).

Worked example

Gamma(5) = 4! = 24. Gamma(1/2) = sqrt(pi), approximately 1.77245385091. Applying the recurrence gives Gamma(-1/2) = -2sqrt(pi).

Advertisement

Frequently asked questions

Why is Gamma(5) not 120?

The factorial identity is Gamma(n + 1) = n!, so Gamma(5) equals 4!.

Which negative inputs are invalid?

Zero and negative integers are poles. Negative non-integers can have finite values.

Are complex results exact?

No. They are floating-point approximations. Inputs near a pole and extreme components can lose accuracy.

Sources

Advertisement