Skip to content

Commit

Permalink
Use pow2 instead of 2.0.pow
Browse files Browse the repository at this point in the history
Signed-off-by: Heinz N. Gies <[email protected]>
  • Loading branch information
Licenser committed Sep 9, 2024
1 parent 25b89db commit ccaf3f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/h2b.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,6 @@ impl<HASH: BuildHasher + Default, BITS: Sketch> HyperTwoBits<BITS, HASH> {
pub fn count(&self) -> u64 {
let beta = 1.0 - f64::from(self.count) / f64::from(BITS::STREAMS);
let bias: f64 = (1.0 / beta).ln();
((2.0_f64.powf(f64::from(self.t))) * f64::from(BITS::STREAMS) * bias) as u64
(f64::from(self.t).exp2() * f64::from(BITS::STREAMS) * bias) as u64
}
}

0 comments on commit ccaf3f9

Please sign in to comment.