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

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Fri Apr 20 18:42:52 CEST 2012


The straight answer is "no", there is plenty of precision available in a double precision float.  Nevertheless, keep in mind that some algorithms require iteration toward their solution and may have function arguments such as "tol" (tolerance) documented in the help files that define "good enough" for a particular calculation, and it is up to you to change these in the function call if the default doesn't work for your application. 

In other words, RTFM, and when that doesn't work Read The Source.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

"R. Michael Weylandt" <michael.weylandt at gmail.com> wrote:

>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.
>
>______________________________________________
>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