AMDG On 05/05/2012 10:04 AM, Nelis Willers wrote:
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-sran...
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?
For linear_congruential_engine with c = 0, a seed of 0 is the same as a seed of 1. Other generators have different rules. The standard specifies the exact seeding algorithm. In Christ, Steven Watanabe