Binomial::entropy() at n = u64::MAX returns Some(0.0). On a debug build the same call panics with attempt to add with overflow instead.
Every other n I tried returns a finite value, and the other moments at the same parameters are fine: mean and variance both return the expected finite numbers at n = u64::MAX. So this looks specific to entropy.
Environment: statrs main at 10cf6d610c1b8febc0b0606a443eb5e9d6ac8b7d, rustc 1.97.1, aarch64-apple-darwin
Reproducer
use statrs::distribution::Binomial;
use statrs::statistics::Distribution;
fn main() {
let dist = Binomial::new(0.5, u64::MAX).unwrap();
println!("{:?}", dist.entropy());
}
$ cargo run --release
Some(0.0)
$ cargo run
thread 'main' panicked at src/distribution/binomial/mod.rs:222:17:
attempt to add with overflow
Binomial::entropy()atn = u64::MAXreturnsSome(0.0). On a debug build the same call panics withattempt to add with overflowinstead.Every other
nI tried returns a finite value, and the other moments at the same parameters are fine:meanandvarianceboth return the expected finite numbers atn = u64::MAX. So this looks specific toentropy.Environment: statrs
mainat10cf6d610c1b8febc0b0606a443eb5e9d6ac8b7d, rustc 1.97.1, aarch64-apple-darwinReproducer