Is Euler–Mascheroni's constant $\gamma \approx 0.577$ available in R, similarly to $\pi$ with pi
or $e$ with exp(1)
?
Mathmatically we can write the constant of interest as the negative of the derivative of the gamma function evaluated at 1. R has the derivative of the gamma function as digamma
so it's just a matter of plugging this in.
-digamma(1)
#[1] 0.5772157
Like this:
eulergamma = 0.57721566490153 # just copy from e.g. wiki to whatever precision you need it
Now use it ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With