Skip to content

Commit

Permalink
chore: run clippy lint
Browse files Browse the repository at this point in the history
  • Loading branch information
YeungOnion authored and Maxyme committed Jul 5, 2024
1 parent 21b467d commit 6a22355
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/stats_tests/fisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ pub fn fishers_exact(table: &[u64; 4], alternative: Alternative) -> Result<f64,
let dist = Hypergeometric::new(population, successes, draws)?;

let p_exact = dist.pmf(table[0]);
let mode = ((n + 1) * (n1 + 1)) / (n1 + n2 + 2) as u64;
let mode = ((n + 1) * (n1 + 1)) / (n1 + n2 + 2);
let p_mode = dist.pmf(mode);

if (p_exact - p_mode).abs() / p_exact.max(p_mode) <= 1.0 - EPSILON {
Expand Down Expand Up @@ -342,7 +342,7 @@ mod tests {
.iter()
.zip(vec![less_expected, greater_expected, two_sided_expected])
{
let p_value = fishers_exact(&table, *alternative).unwrap();
let p_value = fishers_exact(table, *alternative).unwrap();
assert!(prec::almost_eq(p_value, *expected, 1e-12));
}
}
Expand Down

0 comments on commit 6a22355

Please sign in to comment.