cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject git commit: Use double math for double results in StreamingHistogram
Date Fri, 16 Mar 2012 10:16:25 GMT
Updated Branches:
  refs/heads/trunk 65c33fac9 -> 23b1c5249


Use double math for double results in StreamingHistogram

patch by dbrosius; reviewed by slebresne for CASSANDRA-4057


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/23b1c524
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/23b1c524
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/23b1c524

Branch: refs/heads/trunk
Commit: 23b1c52498a00c27cf5c5124241555aad7127966
Parents: 65c33fa
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Fri Mar 16 11:14:12 2012 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Fri Mar 16 11:14:12 2012 +0100

----------------------------------------------------------------------
 .../apache/cassandra/utils/StreamingHistogram.java |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/23b1c524/src/java/org/apache/cassandra/utils/StreamingHistogram.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/StreamingHistogram.java b/src/java/org/apache/cassandra/utils/StreamingHistogram.java
index 38b9add..98f1ce9 100644
--- a/src/java/org/apache/cassandra/utils/StreamingHistogram.java
+++ b/src/java/org/apache/cassandra/utils/StreamingHistogram.java
@@ -154,7 +154,7 @@ public class StreamingHistogram
             double mb = pi.getValue() + (pnext.getValue() - pi.getValue()) * weight;
             sum += (pi.getValue() + mb) * weight / 2;
 
-            sum += pi.getValue() / 2;
+            sum += pi.getValue() / 2.0;
             for (Long value : bin.headMap(pi.getKey(), false).values())
                 sum += value;
         }


Mime
View raw message