statrs-dev / statrs

Statistical computation library for Rust
https://docs.rs/statrs/latest/statrs/
MIT License
603 stars 84 forks source link

Feature request: Implement Distribution<u64> for Geometric #300

Closed nielsle closed 2 months ago

nielsle commented 2 months ago

The geometric distribution is an integer distribution, but the struct named Geometric implements Distribution<f64>.

It would be great to implement Distribution<u64> as well.

Links for reference: https://docs.rs/statrs/latest/statrs/distribution/struct.Geometric.html https://rust-random.github.io/rand/rand_distr/struct.Geometric.html

YeungOnion commented 2 months ago

155 implements this!

If you want it from crates.io, I'm the holdup for the release, wanting to get in the last major chunk of breaking changes we know about in this one. If you'd like to implement something that better handles low probability, that would be welcome!