Skip to content

Commit

Permalink
Fix bug #21 - Producing NaN as f64 overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaparmigiani committed Apr 18, 2024
1 parent f2a1ca8 commit 848653f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/hist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,12 @@ impl Hist {
}
q[i][j] += (n as f64 - i as f64 - m as f64 + 1.0 + j as f64).log2();
q[i][j] -= (m as f64 - j as f64).log2();
sum_q += q[i][j].exp2();
sum_q += (q[i][j] + m_fact - n_fall_m).exp2();
add = true;
}
}
if add {
yr += ((self.coverage[i] as f64).log2() + sum_q.log2() + m_fact - n_fall_m)
.exp2();
yr += ((self.coverage[i] as f64).log2() + sum_q.log2()).exp2();
}
}
pangrowth[m - 1] = yl + yr;
Expand Down

0 comments on commit 848653f

Please sign in to comment.