You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
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.).
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?
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 berand::random_range(low, high)
as a shortcut forthread_rng().gen_range(low, high)
.The text was updated successfully, but these errors were encountered: