3 ms·
The generator/seeding design is gnarly, totally agreed. I do want to disagree with the author on distributions. In most scenarios it is totally sufficient for
by tpolzer 6y ago
The generator/seeding design is gnarly, totally agreed.
I do want to disagree with the author on distributions. In most scenarios it is totally sufficient for distributions to be deterministic and reproducible on a given implementation/architecture instead of ossifying them to one implementation mandated by the standard.
- ur-whale 6y ago>n most scenarios it is totally sufficient for distributions to be deterministic and reproducible on a given implementation/architecture instead of ossifying them to one implementation mandated by the standard. Distributions are dog slow.
- tpolzer 6y agoCompared to what? Taking rand()%n? Of course they're usually slower than that, because they provide better quality distribution of random numbers.
- ur-whale 6y ago>Compared to what? Look at the "Conclusion" section of this article: https://www.pcg-random.org/posts/bounded-rands.html https://www.pcg-random.org/posts/bounded-rands.html