Skip to content

Commit 856fdfb

Browse files
committed
Distribution: add doc of portability
1 parent 72af6f8 commit 856fdfb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/distributions/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ mod utils;
173173
/// advantage of not needing to consider thread safety, and for most
174174
/// distributions efficient state-less sampling algorithms are available.
175175
///
176+
/// Implementations are typically expected to be portable with reproducible
177+
/// results when used with a PRNG with fixed seed; see the
178+
/// [portability chapter](https://rust-random.github.io/book/portability.html)
179+
/// of The Rust Rand Book. In some cases this does not apply, e.g. the `usize`
180+
/// type requires different sampling on 32-bit and 64-bit machines.
181+
///
176182
/// [`sample_iter`]: Distribution::method.sample_iter
177183
pub trait Distribution<T> {
178184
/// Generate a random value of `T`, using `rng` as the source of randomness.

0 commit comments

Comments
 (0)