New Lagged Fib. PRNG gen and random2.d

monarch_dodra monarchdodra at gmail.com
Mon Aug 26 23:16:43 PDT 2013


On Monday, 26 August 2013 at 21:20:25 UTC, Joseph Rushton
Wakeling wrote:
> On 26/08/13 17:26, monarch_dodra wrote:
>> One more thing. One of the ways I see it (specifically for 
>> LF): We can add
>> auto-seed later if we decide it was a bad idea to not have it. 
>> The opposite
>> isn't possible.
>
> One note on seeding.  As it stands, some RNGs do have a valid 
> default configuration _without_ seed() being called -- see e.g. 
> Xorshift.

What bothers me about these is that they have a fixed seed value,
which (IMO) is even worst than default seeding to
"unpredicatableSeed"

C's "rand" also "defaults seed". I've "tutored" C++ on codeguru
for years, and years in and years out, I'd get asked "why does my
random program keep creating the same output". This behavior
surprises people.

A PRNG should either error-out on no-seed, or be run-time
unpredictably seeded. The middle ground just gives you the worst
of both...


More information about the Digitalmars-d mailing list