random module gives same results across all configurations?

Diez B. Roggisch deets at nospam.web.de
Wed Mar 4 02:26:19 EST 2009


Amir Michail schrieb:
> On Mar 3, 10:05 pm, Chris Rebert <c... at rebertia.com> wrote:
>> On Tue, Mar 3, 2009 at 6:59 PM, Amir Michail <amich... at gmail.com> wrote:
>>> Hi,
>>> Is it the case that the random module will always give the same
>>> results if given the same seed across all configurations (e.g.,
>>> architectures, compilers, etc.)?
>> Your question is vague. Define what you mean by "same results" in this context.
> 
> In Python 2.5, if you use the same seed, will calls to randrange yield
> the same numbers across all configurations?

What do you mean with "configurations"?


Random uses AFAIK rand/srand from the stdlib.h of your platform (*nix, 
no idea how that beast is called in redmond).

So whatever the behaviour, it will be driven by that, and I guess it 
varies between platforms.

Diez



More information about the Python-list mailing list