提交 a5763287 编写于 作者: M Mohit Saxena

Adding condition to check for Zero values

上级 b5c96535
...@@ -296,7 +296,7 @@ double tdigestQuantile(TDigest *t, double q) { ...@@ -296,7 +296,7 @@ double tdigestQuantile(TDigest *t, double q) {
a = b; a = b;
right = t->max; right = t->max;
if (idx < weight_so_far + a->weight) { if (idx < weight_so_far + a->weight && a->weight != 0) {
double p = (idx - weight_so_far) / a->weight; double p = (idx - weight_so_far) / a->weight;
return left * (1 - p) + right * p; return left * (1 - p) + right * p;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册