[R] Mean calculated from R1.9.1 different from R2.0.1

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Feb 10 14:13:53 CET 2005


On Thu, 10 Feb 2005, Campbell wrote:

> This may or may not be related,

It is completely unrelated: see earlier replies in this thread.

> but looking at the random number
> generators in Numerical Recipies In C book it would appear that random
> number generators with identical seeds will give different results
> depending upon whther they are compliled with 64 bit or 32 bit
> settings.
>
>
> Is this the case with the random number generators in R?

No, as R cannot be `compliled with 64 bit or 32 bit settings', whatever 
that is supposed to mean.

If your concern is with 32- vs 64- bit ints, we do ensure that R is 
compiled with 32-bit ints, and we do check the operation of the basic 
random number generators.  On the other hand, all known 64-bit ports of R 
use IEC60559 doubles (8 bytes, effective 53-bit mantissa), as do all 
current 32-bit ports that I am aware of.

At least on machines with standard IEC60559 arithmetic you will get the 
same stream of random numbers on every implementation.  Now GCC does not
support fully IEC60559 on ix86 and some other chips, but lots of testing 
has shown that to be close enough to be true for practical purposes.
Lots of R tests do use specific starting seeds and do give the same 
answers of many different architectures up to rounding error (the issue 
here).

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list