diff options
Diffstat (limited to 'src/libcore/rand.rs')
| -rw-r--r-- | src/libcore/rand.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/libcore/rand.rs b/src/libcore/rand.rs index 9fa099cabbf..80f69f067eb 100644 --- a/src/libcore/rand.rs +++ b/src/libcore/rand.rs @@ -16,6 +16,9 @@ and so can be used to generate any type that implements `Rand`. Type inference means that often a simple call to `rand::random()` or `rng.gen()` will suffice, but sometimes an annotation is required, e.g. `rand::random::<float>()`. +See the `distributions` submodule for sampling random numbers from +distributions like normal and exponential. + # Examples ~~~ use core::rand::RngUtil; @@ -47,6 +50,9 @@ use util; use vec; use libc::size_t; +#[path="rand/distributions.rs"] +pub mod distributions; + /// A type that can be randomly generated using an Rng pub trait Rand { fn rand<R: Rng>(rng: &R) -> Self; @@ -1067,12 +1073,3 @@ mod tests { } } } - - -// Local Variables: -// mode: rust; -// fill-column: 78; -// indent-tabs-mode: nil -// c-basic-offset: 4 -// buffer-file-coding-system: utf-8-unix -// End: |
