Skip to content

Commit 8a07c93

Browse files
authored
Merge pull request #1138 from striezel-stash/fix-typos
fix some typos
2 parents 8792268 + 277e5b0 commit 8a07c93

File tree

16 files changed

+22
-22
lines changed

16 files changed

+22
-22
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,4 +678,4 @@ when updating from `rand 0.7.0` without also updating `rand_core`.
678678

679679
## [0.10-pre] - 2014-03-02
680680
### Added
681-
- Seperate `rand` out of the standard library
681+
- Separate `rand` out of the standard library

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ unavailable.
143143

144144
The WASM target `wasm32-unknown-unknown` is not *automatically* supported by
145145
`rand` or `getrandom`. To solve this, either use a different target such as
146-
`wasm32-wasi` or add a direct dependancy on `getrandom` with the `js` feature
146+
`wasm32-wasi` or add a direct dependency on `getrandom` with the `js` feature
147147
(if the target supports JavaScript). See
148148
[getrandom#WebAssembly support](https://docs.rs/getrandom/latest/getrandom/#webassembly-support).
149149

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ No binding guarantees can be provided.
88
## Security premises
99

1010
Rand provides the trait `rand_core::CryptoRng` aka `rand::CryptoRng` as a marker
11-
trait. Generators implementating `RngCore` *and* `CryptoRng`, and given the
11+
trait. Generators implementing `RngCore` *and* `CryptoRng`, and given the
1212
additional constraints that:
1313

1414
- Instances of seedable RNGs (those implementing `SeedableRng`) are

rand_core/src/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ pub trait BlockRngCore {
9595
/// [`fill_bytes`] / [`try_fill_bytes`] is called on a large array. These methods
9696
/// also handle the bookkeeping of when to generate a new batch of values.
9797
///
98-
/// No whole generated `u32` values are thown away and all values are consumed
98+
/// No whole generated `u32` values are thrown away and all values are consumed
9999
/// in-order. [`next_u32`] simply takes the next available `u32` value.
100100
/// [`next_u64`] is implemented by combining two `u32` values, least
101101
/// significant first. [`fill_bytes`] and [`try_fill_bytes`] consume a whole

rand_distr/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ for some distributions (in particular, `Dirichlet` and `WeightedAliasIndex`).
2828

2929
The floating point functions from `num_traits` and `libm` are used to support
3030
`no_std` environments and ensure reproducibility. If the floating point
31-
functions from `std` are prefered, which may provide better accuracy and
31+
functions from `std` are preferred, which may provide better accuracy and
3232
performance but may produce different random values, the `std_math` feature
3333
can be enabled.
3434

rand_distr/src/binomial.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl Distribution<u64> for Binomial {
105105
// random variate generation. Commun. ACM 31, 2 (February 1988),
106106
// 216-222. http://dx.doi.org/10.1145/42372.42381
107107

108-
// Threshold for prefering the BINV algorithm. The paper suggests 10,
108+
// Threshold for preferring the BINV algorithm. The paper suggests 10,
109109
// Ranlib uses 30, and GSL uses 14.
110110
const BINV_THRESHOLD: f64 = 10.;
111111

@@ -242,7 +242,7 @@ impl Distribution<u64> for Binomial {
242242
}
243243
}
244244

245-
// Step 5.2: Squeezing. Check the value of ln(v) againts upper and
245+
// Step 5.2: Squeezing. Check the value of ln(v) against upper and
246246
// lower bound of ln(f(y)).
247247
let k = k as f64;
248248
let rho = (k / npq) * ((k * (k / 3. + 0.625) + 1. / 6.) / npq + 0.5);

rand_distr/src/hypergeometric.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ enum SamplingMethod {
2929
/// `f(k) = binomial(K, k) * binomial(N-K, n-k) / binomial(N, n)`,
3030
/// where `binomial(a, b) = a! / (b! * (a - b)!)`.
3131
///
32-
/// The [binomial distribution](crate::Binomial) is the analagous distribution
32+
/// The [binomial distribution](crate::Binomial) is the analogous distribution
3333
/// for sampling with replacement. It is a good approximation when the population
3434
/// size is much larger than the sample size.
3535
///

rand_distr/src/poisson.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ where F: Float + FloatConst, Standard: Distribution<F>
109109
loop {
110110
// draw from the Cauchy distribution
111111
comp_dev = rng.sample(cauchy);
112-
// shift the peak of the comparison ditribution
112+
// shift the peak of the comparison distribution
113113
result = self.sqrt_2lambda * comp_dev + self.lambda;
114114
// repeat the drawing until we are in the range of possible values
115115
if result >= F::zero() {

rand_distr/src/utils.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ where
9191
let i = bits as usize & 0xff;
9292

9393
let u = if symmetric {
94-
// Convert to a value in the range [2,4) and substract to get [-1,1)
94+
// Convert to a value in the range [2,4) and subtract to get [-1,1)
9595
// We can't convert to an open range directly, that would require
96-
// substracting `3.0 - EPSILON`, which is not representable.
96+
// subtracting `3.0 - EPSILON`, which is not representable.
9797
// It is possible with an extra step, but an open range does not
98-
// seem neccesary for the ziggurat algorithm anyway.
98+
// seem necessary for the ziggurat algorithm anyway.
9999
(bits >> 12).into_float_with_exponent(1) - 3.0
100100
} else {
101-
// Convert to a value in the range [1,2) and substract to get (0,1)
101+
// Convert to a value in the range [1,2) and subtract to get (0,1)
102102
(bits >> 12).into_float_with_exponent(0) - (1.0 - core::f64::EPSILON / 2.0)
103103
};
104104
let x = u * x_tab[i];

rand_hc/src/hc128.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl BlockRngCore for Hc128Core {
142142
let dd = (cc + 16) % 512;
143143
let ee = cc.wrapping_sub(16) % 512;
144144
// These asserts let the compiler optimize out the bounds checks.
145-
// Some of them may be superflous, and that's fine:
145+
// Some of them may be superfluous, and that's fine:
146146
// they'll be optimized out if that's the case.
147147
assert!(ee + 15 < 512);
148148
assert!(cc + 15 < 512);
@@ -238,7 +238,7 @@ impl Hc128Core {
238238
let dd = (cc + 16) % 512;
239239
let ee = cc.wrapping_sub(16) % 512;
240240
// These asserts let the compiler optimize out the bounds checks.
241-
// Some of them may be superflous, and that's fine:
241+
// Some of them may be superfluous, and that's fine:
242242
// they'll be optimized out if that's the case.
243243
assert!(ee + 15 < 512);
244244
assert!(cc + 15 < 512);

0 commit comments

Comments
 (0)