[R] Precision

Jason Turner jasont at indigoindustrial.co.nz
Sat Dec 6 19:54:48 CET 2003


forkusam wrote:
>  Hi, 
> I would like to increase the Precision of R  by
> increasing the Number of decimal places in 
> calcultaions. I get about 7 decimal places and would
> like to have over 15. is the a means to inflence this?

R uses double-precision  for *all* internal floating point numbers. 
These are 64 bits, on most machines these days.

If you want to change the *display* of your results, use format()  e.g.

pi
format(pi, digits=15)

If you find that you're getting rounding error in your calculations when 
using R, check your calculation or algorithm, and see if there's a more 
numerically stable way to do it.

Cheers

Jason
-- 
Indigo Industrial Controls Ltd.
http://www.indigoindustrial.co.nz
64-21-343-545
jasont at indigoindustrial.co.nz




More information about the R-help mailing list