Skip to content

Commit

Permalink
Accepted changes added crate::prec so would run
Browse files Browse the repository at this point in the history
  • Loading branch information
bbbruce authored and KOVALW committed Feb 12, 2025
1 parent a21cf4b commit 2832c12
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/distribution/negative_binomial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ mod tests {

#[test]
fn test_sample() {
use crate::prec;
use rand::{distributions::Distribution, SeedableRng, rngs::StdRng};

let dist = NegativeBinomial::new(4.0, 0.5).unwrap();
Expand All @@ -504,7 +505,7 @@ mod tests {
let theoretical_mean = dist.mean().unwrap();
let theoretical_variance = dist.variance().unwrap();

assert!((sample_mean - theoretical_mean).abs() < tol);
assert!((sample_variance - theoretical_variance).abs() < tol);
assert!(prec::almost_eq(sample_mean, theoretical_mean, tol));
assert!(prec::almost_eq(sample_variance, theoretical_variance, tol));
}
}

0 comments on commit 2832c12

Please sign in to comment.