gamma(x)
computes Gamma () of x
. For positive, integer values of x
the Gamma function simplifies to the factorial function .
Fortran 2008 and later
x = gamma(x)
x
- Shall be of type real
and neither zero nor a negative integer.The return value is of type real
of the same kind as x
.
program test_gamma
real :: x = 1.0
x = gamma(x) ! returns 1.0
end program test_gamma
Logarithm of the Gamma function: log_gamma