Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I obtain the machine epsilon in R?

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

like image 384
xiaodai Avatar asked Apr 12 '10 02:04

xiaodai


People also ask

What is machine epsilon in numerical analysis?

Machine epsilon or machine precision is an upper bound on the relative approximation error due to rounding in floating point arithmetic. This value characterizes computer arithmetic in the field of numerical analysis, and by extension in the subject of computational science.

What is the order of machine epsilon?

Machine epsilon (the smallest number recognized by the computer as very much greater than zero as well as dwarf in magnitude and when added to 1 produces a different number). The machine epsilon (in double precision) is eps =2.220446049250313e−016. It is obtained when the number of terms is n =53.


1 Answers

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>  
like image 189
Dirk Eddelbuettel Avatar answered Sep 22 '22 17:09

Dirk Eddelbuettel