1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Items related to randomness and random number generators. Also provides some high-level helper
//! functions including [**random_f32()**](./fn.random_f32.html), [**random_f64()**](./fn.random_f64.html)
//! and [**random_range(min, max)**](./fn.random_f32.html).
pub use rand;
pub use *;
/// A wrapper function around the `random` function that avoids the need for specifying a type in
/// the case that it cannot be inferred. The primary purpose for this is to simplify the random API
/// for new rust users.
/// A wrapper function around the `random` function that avoids the need for specifying a type in
/// the case that it cannot be inferred. The primary purpose for this is to simplify the random API
/// for new rust users.
/// 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.