How do I obtain the machine epsilon in R?

家住魔仙堡 提交于 2020-06-09 10:59:08

问题


Is there a constant that stores the machine epsilon in R?


回答1:


Try .Machine$double.eps -- and .Machine which on my 32-bit Linux machine yields this:

R> .Machine
$double.eps
[1] 2.220e-16

$double.neg.eps
[1] 1.110e-16

$double.xmin
[1] 2.225e-308

$double.xmax
[1] 1.798e+308

$double.base
[1] 2

$double.digits
[1] 53

$double.rounding
[1] 5

$double.guard
[1] 0

$double.ulp.digits
[1] -52

$double.neg.ulp.digits
[1] -53

$double.exponent
[1] 11

$double.min.exp
[1] -1022

$double.max.exp
[1] 1024

$integer.max
[1] 2147483647

$sizeof.long
[1] 4

$sizeof.longlong
[1] 8

$sizeof.longdouble
[1] 12

$sizeof.pointer
[1] 4

R> 



回答2:


I believe that you want .Machine$double.eps.




回答3:


I know this thread is 5 years old, but I just wanted to point out that these are standard values for the IEEE single-precision and double-precision standard, which is used by the vast majority of consumer-level statistics packages.



来源:https://stackoverflow.com/questions/2619543/how-do-i-obtain-the-machine-epsilon-in-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!