|Title||Calculating the Euler–Mascheroni constant|
|Author||Nicholas J. Cox, Durham University, UK|
The Euler–Mascheroni constant gamma = 0.57721 ... is one of the most important constants in mathematics. For some background, see Havil (2003) and/or Finch (2003, 28–40). In statistics, gamma arises, for example, in the theory of certain probability distributions.
In Stata, gamma can be calculated using the function digamma() as -digamma(1) (note the negative sign). For example,
. di %12.10f -digamma(1)
yields 0.5772156649. See also math functions for details about related functions.