diff --git a/src/main/java/com/clearspring/analytics/stream/cardinality/HyperLogLog.java b/src/main/java/com/clearspring/analytics/stream/cardinality/HyperLogLog.java index 0e9e6800b..741eb14dc 100644 --- a/src/main/java/com/clearspring/analytics/stream/cardinality/HyperLogLog.java +++ b/src/main/java/com/clearspring/analytics/stream/cardinality/HyperLogLog.java @@ -169,7 +169,7 @@ public long cardinality() { double zeros = 0.0; for (int j = 0; j < registerSet.count; j++) { int val = registerSet.get(j); - registerSum += 1.0 / (1 << val); + registerSum += 1.0 / (1L << val); if (val == 0) { zeros++; }