Function: gamma
Section: transcendental
C-Name: ggamma
Prototype: Gp
Help: gamma(s): gamma function at s, a complex or p-adic number, or a series.
Doc: For $s$ a complex number, evaluates Euler's gamma
 function\sidx{gamma-function}, which is the analytic continuation of
 $$\Gamma(s)=\int_{0}^{\infty} t^{s-1}\exp(-t)\,dt,\quad \Re(s) > 0.$$
 Error if $s$ is a nonpositive integer, where $\Gamma$ has a (simple) pole.
 \bprog
 ? gamma(5)  \\ @com $\Gamma(n) = (n-1)!$ for a positive integer $n$
 %1 = 24.000000000000000000000000000000000000
 ? gamma(0)
  ***   at top-level: gamma(0)
  ***                 ^--------
  *** gamma: domain error in gamma: argument = nonpositive integer

 ? gamma(x + O(x^3))
 %2 = x^-1 - 0.57721566490153286060651209008240243104 + O(x)
 @eprog

 For $s$ a \typ{PADIC}, evaluates the Morita gamma function at $s$, that
 is the unique continuous $p$-adic function on the $p$-adic integers
 extending $\Gamma_{p}(k)=(-1)^{k} \prod_{j<k}'j$, where the prime means that
 $p$ does not divide $j$.
 \bprog
 ? gamma(1/4 + O(5^10))
 %1= 1 + 4*5 + 3*5^4 + 5^6 + 5^7 + 4*5^9 + O(5^10)
 ? algdep(%,4)
 %2 = x^4 + 4*x^2 + 5
 @eprog
Variant: For a \typ{PADIC} $x$, the function \fun{GEN}{Qp_gamma}{GEN x} is
 also available.
