rust-random / rand

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

Incorrect Comment? #1445

Closed idontgetoutmuch closed 1 month ago

idontgetoutmuch commented 6 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 5 months 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.