rust-random / rand

A Rust library for random number generation.
https://crates.io/crates/rand
Other
1.6k stars 423 forks source link

Incorrect Comment? #1445

Open idontgetoutmuch opened 2 months ago

idontgetoutmuch commented 2 months ago

https://github.com/rust-random/rand/blob/4f8257a98685e19711d9e34708df594747ade98b/rand_distr/src/binomial.rs#L172

presumably

// p1 + area of left tail

should be

// p2 + area of left tail
dhardy commented 3 weeks ago

You are probably right; similarly for the next comment down.

In general, such comments are not especially useful; in this case it makes more sense to refer to the paper to understand the algorithm: https://dl.acm.org/doi/pdf/10.1145/42372.42381

Suggestion: remove these comments.