From 856fdfb4331188e3fd91ab8b31a11df86b6122b9 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Sun, 15 Sep 2019 12:01:05 +0100 Subject: [PATCH] Distribution: add doc of portability --- src/distributions/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/distributions/mod.rs b/src/distributions/mod.rs index 02ece6f98ef..f43169958e5 100644 --- a/src/distributions/mod.rs +++ b/src/distributions/mod.rs @@ -173,6 +173,12 @@ mod utils; /// advantage of not needing to consider thread safety, and for most /// distributions efficient state-less sampling algorithms are available. /// +/// Implementations are typically expected to be portable with reproducible +/// results when used with a PRNG with fixed seed; see the +/// [portability chapter](https://rust-random.github.io/book/portability.html) +/// of The Rust Rand Book. In some cases this does not apply, e.g. the `usize` +/// type requires different sampling on 32-bit and 64-bit machines. +/// /// [`sample_iter`]: Distribution::method.sample_iter pub trait Distribution { /// Generate a random value of `T`, using `rng` as the source of randomness.