Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Commit

Permalink
fix: nulls in t-digest (#146)
Browse files Browse the repository at this point in the history
**Summary**: Fixed bug where nulls appeared in t-digest.

**Details:**
* Fixed integration test to detect bug, then fixed bug.
  • Loading branch information
wangpatrick57 authored Mar 31, 2024
1 parent 68666c4 commit e35d508
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion optd-gungnir/src/utils/arith_encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ lazy_static! {

pub fn encode(string: &str) -> f64 {
let mut left = 0.0;
let mut right = f64::MAX;
// 1000.0 is fairly arbitrary. don't make it f64::MAX though because it causes overflow in other places of the code
let mut right = 1000.0;

for char in string.chars() {
let cdf = CDF.get(&char).unwrap_or(&1.0);
Expand Down
1 change: 0 additions & 1 deletion optd-perftest/tests/cardtest_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ mod tests {
// make sure scale factor is low so the test runs fast
"--scale-factor",
"0.01",
"--rebuild-cached-optd-stats",
"--pguser",
"test_user",
"--pgpassword",
Expand Down

0 comments on commit e35d508

Please sign in to comment.