Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Random" instruction should not use rand() #586

Open
mehagar opened this issue Mar 19, 2019 · 0 comments
Open

"Random" instruction should not use rand() #586

mehagar opened this issue Mar 19, 2019 · 0 comments
Labels

Comments

@mehagar
Copy link
Contributor

mehagar commented Mar 19, 2019

From http://www.cplusplus.com/reference/cstdlib/rand/:

"Notice though that this modulo operation does not generate uniformly distributed random numbers in the span (since in most cases this operation makes lower numbers slightly more likely)."

Instead, use the facilities in the <random> header to generate a uniform distribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants