[R] Is there a overall calculation precision control in R

R. Michael Weylandt michael.weylandt at gmail.com
Fri Apr 20 18:13:58 CEST 2012


On the R level, I believe you're limited by the type of numeric
representation being used: either 32-big integer or 64-bit double. See
the storage.mode() of your objects. External code can make use of
128-bit types if desired, but I don't believe those can be naturally
represented back at the R level. Note, e.g.,:

x <- 2147483647L
storage.mode(x)
x +1L

which (for me) gives the same results on R32 and R64.

One exception I know of is that Romain has done the hard work to
provide a 64 bit integer here (package on CRAN):
http://romainfrancois.blog.free.fr/index.php?post/2011/11/26/int64%3A-64-bit-integer-vectors-for-R
but they aren't used in most packages so you'll have to make sure
whatever algorithms you use play nice.

Michael Weylandt

On Fri, Apr 20, 2012 at 12:06 PM, Michael <comtech.usa at gmail.com> wrote:
> Hi all,
>
> I know the overall display precision can be changed in R...
>
> but what about overall calculation precision?
>
> Thank you!
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list