#
Fortran Wiki

gamma

## Description

`gamma(x)`

computes Gamma ($\Gamma$) of `x`

. For positive, integer values of `x`

the Gamma function simplifies to the factorial function $\Gamma(x)=(x-1)!$.

$\Gamma(x) = \int_0^\infty t^{x-1}{\mathrm{e}}^{-t}\,{\mathrm{d}}t$

## Standard

Fortran 2008 and later

## Class

Elemental function

## Syntax

`x = gamma(x)`

## Arguments

`x`

- Shall be of type `real`

and neither zero nor a negative integer.

## Return value

The return value is of type `real`

of the same kind as `x`

.

## Example

```
program test_gamma
real :: x = 1.0
x = gamma(x)
end program test_gamma
```

## See also

Logarithm of the Gamma function: log_gamma

Revised on September 19, 2010 20:17:01
by

Jason Blevins
(174.101.53.244)
(761 characters / 0.0 pages)