eulergamma
Euler-Mascheroni constant
Syntax
Description
eulergamma
represents the Euler-Mascheroni
constant. To get a floating-point approximation with the current
precision set by digits
, use vpa(eulergamma)
.
Examples
Represent and Numerically Approximate the Euler-Mascheroni Constant
Represent the Euler-Mascheroni constant using eulergamma
,
which returns the symbolic form eulergamma
.
eulergamma
ans = eulergamma
Use eulergamma
in symbolic calculations.
Numerically approximate your result with vpa
.
a = eulergamma; g = a^2 + log(a) gVpa = vpa(g)
g = log(eulergamma) + eulergamma^2 gVpa = -0.21636138917392614801928563244766
Find the double-precision approximation of the Euler-Mascheroni
constant using double
.
double(eulergamma)
ans = 0.5772
Show Relation of Euler-Mascheroni Constant to Gamma Functions
Show the relations between the Euler-Mascheroni constant γ, digamma function Ψ, and gamma function Γ.
Show that .
-psi(sym(1))
ans = eulergamma
Show that .
syms x -subs(diff(gamma(x)),x,1)
ans = eulergamma
More About
Tips
For the value e = 2.71828…, called Euler’s number, use
exp(1)
to return the double-precision representation. For the exact representation of Euler’s number e, callexp(sym(1))
.For the other meaning of Euler’s numbers and for Euler’s polynomials, see
euler
.
Version History
Introduced in R2014a