Navigation

Operators and Keywords

Function List:

C++ API

: gamma (z)

Compute the Gamma function.

The Gamma function is defined as

            infinity
           /
gamma (z) = |t^(z-1) exp (-t) dt.
           /
        t=0

Programming Note: The gamma function can grow quite large even for small input values. In many cases it may be preferable to use the natural logarithm of the gamma function (gammaln) in calculations to minimize loss of precision. The final result is then exp (result_using_gammaln).

See also: gammainc, gammaln, factorial.

Package: octave