in reply to Re^8: Late PM, 12/24/2014 & all year long
in thread Late PM, 12/24/2014 & all year long
I just think they should have mentioned, in the srand documentation, that srand(42) would produce different results (on Windows) for 5.20.0 as compared to earlier perl versions - but the srand documentation (as it stands) suggests to me that no such change is to be expected.
I think that it is inherent that if the implementation of rand changes, then the effect of srand( N ) will also change. It couldn't be otherwise.
Effectively, all PRNG produce a fixed sequence of numbers of some length and then wrap-around to the beginning and produce the same sequence again.
All srand does it pick a fixed offset into the sequence from which to start.
Supplying the same offset to two different PRNG sequences will (usually) result in a different first value. And the subsequent sequence of values will definitely be different.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^10: Late PM, 12/24/2014 & all year long
by syphilis (Archbishop) on Dec 30, 2014 at 13:12 UTC | |
by BrowserUk (Patriarch) on Dec 30, 2014 at 13:32 UTC |