Is continuously seeding a random number generator performance intensive?

bearophile bearophileHUGS at lycos.com
Sat Jan 4 13:48:01 PST 2014


Jeroen Bollen:

> Divisions for every result would be expensive, and shifting
> the output wouldn't return a uniform distribution.

If the ulong is uniform, then every of its ubytes is uniform. So 
"& ubyte.max" could suffice. If that's not good enough for you, 
then you can xor together the eight ubytes of the ulong with some 
masking & shifts :-)

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list