rust-random / rand

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

Poisson u64 sampling #1498

Closed benjamin-lieser closed 1 month ago

benjamin-lieser commented 1 month ago

Summary

This addresses https://github.com/rust-random/rand/issues/1497 by adding Distribution<u64> It also solves https://github.com/rust-random/rand/issues/1312 by not allowing lambda bigger than 1.844e19 (this also makes them always fit into u64)

Details

The Distribution<u64> is a breaking change and will have a bit of negative impact on the call side, because it requires sometimes type annotations. Alternatively we keep the maximum lambda and document that it is always safe to just as u64 on the samples if required.