@@ -17,16 +17,16 @@ use distributions::float::IntoFloat;
17
17
/// Sample values uniformly between two bounds.
18
18
///
19
19
/// `Range::new` and `Range::new_inclusive` will set up a `Range`, which does
20
- /// some preparations up front to make sampeling values faster.
21
- /// `Range::sample_single` is optimized for sampeling values once or only a
20
+ /// some preparations up front to make sampling values faster.
21
+ /// `Range::sample_single` is optimized for sampling values once or only a
22
22
/// limited number of times from a range.
23
23
///
24
24
/// If you need to sample many values from a range, consider using `new` or
25
25
/// `new_inclusive`. This is also the best choice if the range is constant,
26
26
/// because then the preparations can be evaluated at compile-time.
27
27
/// Otherwise `sample_single` may be the best choice.
28
28
///
29
- /// Sampeling uniformly from a range can be surprisingly complicated to be both
29
+ /// Sampling uniformly from a range can be surprisingly complicated to be both
30
30
/// generic and correct. Consider for example edge cases like `low = 0u8`,
31
31
/// `high = 170u8`, for which a naive modulo operation would return numbers less
32
32
/// than 85 with double the probability to those greater than 85.
@@ -163,7 +163,7 @@ pub trait RangeImpl: Sized {
163
163
/// this.
164
164
///
165
165
/// Via this method range implementations can provide a method optimized for
166
- /// sampeling only a limited number of values from range. The default
166
+ /// sampling only a limited number of values from range. The default
167
167
/// implementation just sets up a range with `RangeImpl::new` and samples
168
168
/// from that.
169
169
fn sample_single < R : Rng + ?Sized > ( low : Self :: X , high : Self :: X , rng : & mut R )
0 commit comments