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

Musl rand #2719

Merged
merged 3 commits into from
Aug 26, 2014
Merged

Musl rand #2719

merged 3 commits into from
Aug 26, 2014

Conversation

juj
Copy link
Collaborator

@juj juj commented Aug 26, 2014

Migrate to using musl functions for random number generation. Fixes issue #2341.

@turol
Copy link

turol commented Aug 26, 2014

I did some testing and it seems that the lowest 3 or 4 bits might not be random. Can you write a testcase which tests %16 or something? This shows why using modulo for reducing the range is a Bad Idea and raises the question "how the hell did this work in the first place?"

@juj
Copy link
Collaborator Author

juj commented Aug 26, 2014

Ok, improved the test to run through all produced bits, not just the lowest one. It does pass on my system.

kripken added a commit that referenced this pull request Aug 26, 2014
@kripken kripken merged commit 6791631 into emscripten-core:incoming Aug 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants