[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Just how predictable is Lua's random function
- From: Rici Lake <lua@...>
- Date: Wed, 21 Feb 2007 12:29:16 -0500
On 21-Feb-07, at 12:25 PM, Jeremy Darling wrote:
Just as the subject says, I'm curious just exactly how predictable the
random function is given a known seed. If I use the same seed on all
platforms (Windows, Linux, and Mac) can I expect the next N calls to
random to always generate the same values? This seems to be the case
on Windows, but I can't validate it on the other platforms (yet).
Lua uses the standard C library random function, which is
deterministic. However, it might not be the same implementation on all
platforms; i.e. you might get a different sequence starting from the
same seed on a 64-bit platform than on a 32-bit platform (for example),
or with different C standard library implementations.