[R] possible to increase precision

Duncan Murdoch murdoch at stats.uwo.ca
Fri Oct 30 23:04:27 CET 2009


On 30/10/2009 5:04 PM, Greg Michaelson wrote:
> I would like to increase the precision/accuracy of R.  That is, I'm  
> dealing with numbers exceedingly close to 1, and I would like to  
> increase the number of significant digits used in computation.  In  
> matlab, you can use vpa() to accomplish this. I'm wondering if there's  
> an equivalent or a workaround in R.

There's a package for extra precision, but you'd probably be better off 
just working with log(x).  That will give you about 300+ digits of 
precision near 1, i.e. log(1 + epsilon) is representable accurately down 
to epsilon=10^(-300).

Duncan Murdoch




More information about the R-help mailing list