[R] Precision in R

Marc Schwartz MSchwartz at MedAnalytics.com
Tue Jul 20 19:50:55 CEST 2004


On Tue, 2004-07-20 at 12:13, Duncan Murdoch wrote:
> On Tue, 20 Jul 2004 11:55:32 -0400, adelmaas at musc.edu wrote :
> >Does anyone know 
> >where I can find specifications for R's type double?  
> 
> As far as I know, all platforms use the IEEE-754 standard double
> precision numbers.  Google will give you a description; here's one:
> 
> http://research.microsoft.com/~hollasch/cgindex/coding/ieeefloat.html
> 
> This isn't relevant to your question, but I found the history of the
> development of the standard interesting:
> 
> http://http.cs.berkeley.edu/~wkahan/ieee754status/754story.html
> 
> Duncan Murdoch


Duncan, 

The standard is there, but not all applications stick to it faithfully.
A good example being how certain <cough> spreadsheets <\cough> deal with
numbers "close to zero".

For example, Excel will round numbers "close to zero" to zero. You may
recall this thread from last year covered this topic

http://maths.newcastle.edu.au/~rking/R/help/03a/6597.html

More information on Excel's varied compliance with the IEEE 754 standard
is available here

http://support.microsoft.com/default.aspx?scid=kb;en-us;78113

The official IEEE 754 page is at http://grouper.ieee.org/groups/754/ and
there are some good reading materials and FAQ's there.

This above is beyond the scope of SAS in particular, but I suspect that
the difference that Aaron is experiencing, as Andy has noted, is
methodologic and not precision related.

Aaron, one other source for information on the precision of R on your
particular machine is the use of .Machine, which will provide you with a
list of specifications. See ?.Machine for additional information here.

HTH,

Marc Schwartz




More information about the R-help mailing list