xorshift icon indicating copy to clipboard operation
xorshift copied to clipboard

reroll if `Rand::rand` gives a zero seed

Open TheIronBorn opened this issue 8 years ago • 1 comments

Currently there's a chance a seed of all zeros could be produced by the other RNG. A zero seed will never produce anything but zero because of the way the RNG works.

"The state must be seeded so that it is not everywhere zero." --http://xoroshiro.di.unimi.it/xoroshiro128plus.c

TheIronBorn avatar Nov 08 '17 05:11 TheIronBorn

The same check could be added to the SeedableRng trait implementation

TheIronBorn avatar Nov 08 '17 05:11 TheIronBorn