Skip to content
Prev 45040 / 398528 Next

LCG with modulo 2^30

One quick addition:

1:2^31 fails because it is trying to create a sequence of integers, and
the largest integer in R is 2^31-1.  For the same sort of reason, the
largest vector you can create is 2^31-1 elements, but on a 32-bit machine
you will run out of address space at 2^29 doubles, and very likely out of
memory before that (as on most 32-bit OSes allow a user process to access
2 or 3Gb rather than the theoretical maximum of 4Gb, to allow for a 
stack, for example).
On Sun, 29 Feb 2004, Sean O'Riordain wrote: