Hacker News new | past | comments | ask | show | jobs | submit login

You seem to be saying that

setSeed(0); setSeed(1); rand()

and

setSeed(1); rand()

returning different values is not only a good idea but is already a thing. Am I wrong?

This would confuse the hell out of me, what specifically has this behaviour?




If you’re trying to create a repeatable source of randomness for unit testing for example, you would create a new PRNG for each run, not try to recycle an existing instance. You’re making assumptions about state that aren’t supportable.


The behavior you are describing is not setting a seed. A seed should wipe out all existing state.

Adding entropy is a very different operation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: