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

Add efficient range function for integral types #20

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

Shihab-Shahriar
Copy link
Collaborator

@Shihab-Shahriar Shihab-Shahriar commented Dec 14, 2023

Code mostly taken from here, credits to Lemire.

For range N and floating point types, we use the basic rand() * N formula in the uniform method.

For integral type, uniform by default uses biased version. Users can use non-biased verison by directly invoking range.

@Shihab-Shahriar Shihab-Shahriar changed the title Add efficient range function for integral types, credits to lemire Add efficient range function for integral types Dec 14, 2023
@Shihab-Shahriar Shihab-Shahriar merged commit 3dc98c9 into msu-sparta:main Dec 14, 2023
2 checks passed
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.

1 participant