9

欧拉-马斯切罗尼常数$\gamma \approx 0.577$ 在 R 中是否可用,类似于 $\pi$ withpi或 $e$ with exp(1)

4

3 回答 3

23

在数学上,我们可以将感兴趣的常数写为 gamma 函数在 1 处求值的导数的负数。R 具有 gamma 函数的导数,digamma因此只需将其插入即可。

-digamma(1)
#[1] 0.5772157
于 2013-08-07T15:09:48.860 回答
1

像这样:

eulergamma = 0.57721566490153 # just copy from e.g. wiki to whatever precision you need it

现在使用它;)

于 2013-08-07T15:03:42.807 回答
-1
print(-digamma(1), digits=22 )
于 2013-08-20T21:12:03.203 回答