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

rand::random_range #953

Closed
olehmisar opened this issue Mar 19, 2020 · 3 comments
Closed

rand::random_range #953

olehmisar opened this issue Mar 19, 2020 · 3 comments

Comments

@olehmisar
Copy link

Feature request

rand::random() is a convenient way to generate random numbers easily without thinking about generators, threads, and other stuff. But it generates only random numbers in a fixed range. It feels like there also should be rand::random_range(low, high) as a shortcut for thread_rng().gen_range(low, high).

@dhardy
Copy link
Member

dhardy commented Mar 19, 2020

Interesting that you propose random_range(low, high) given that we have had so much discussion regarding adding support for ranges (rng.gen_range(low ..= high), rng.gen_range(..high), etc.).

@olehmisar
Copy link
Author

Ah, sorry. I am not an active user of this repository. I use rand crate for my projects and I thought that it would be cool to add random_range. Is it possible to add this feature(I can help implement it) or should I close the issue?

@newpavlov
Copy link
Member

I will close it in favor of #989.

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

No branches or pull requests

3 participants