[−][src]Function nannou::rand::random_range
pub fn random_range<T>(min: T, max: T) -> T where
T: PartialOrd + SampleUniform,
A function for generating a random value within the given range.
The generated value may be within the range [min, max). That is, the result is inclusive of
min
, but will never be max
.
If the given min
is greater than the given max
, they will be swapped before calling
gen_range
internally to avoid triggering a panic!
.
This calls rand::thread_rng().gen_range(min, max)
internally, in turn using the thread-local
default random number generator.