Skip to content

Commit e1f835d

Browse files
committed
Move comment in rand_distr/src/hypergeometric.rs
1 parent f032b61 commit e1f835d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rand_distr/src/hypergeometric.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,9 @@ impl Distribution<u64> for Hypergeometric {
291291
initial_x: mut x,
292292
} => {
293293
let mut u = rng.random::<f64>();
294+
295+
// the paper erroneously uses `until n < p`, which doesn't make any sense
294296
while u > p && x < k as i64 {
295-
// the paper erroneously uses `until n < p`, which doesn't make any sense
296297
u -= p;
297298
p *= ((n1 as i64 - x) * (k as i64 - x)) as f64;
298299
p /= ((x + 1) * (n2 as i64 - k as i64 + 1 + x)) as f64;

0 commit comments

Comments
 (0)