Boost logo

Boost Users :

Subject: [Boost-users] random number generators seeding with 0 and 1
From: Nelis Willers (neliswillers_at_[hidden])
Date: 2012-05-05 13:04:30


Dear Boost Users

While testing my RNG I noticed that the use of seed value 0 yields the same
results as using a seed value of 1.

It seems that this is the specified behaviour for rand() in the C runtime
library:
http://stackoverflow.com/questions/8049556/whats-the-difference-between-srand1-and-srand0

I could find no reference to this in my (oldish) draft C++0x spec.

Also no mention in the boost random doc page. I tried to unravel the
random include files, but got lost.

Is this behaviour required by the specification or just following tradition?

More important, is this behaviour guaranteed in all libraries?

thanks!

nelis



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net