You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2020/02/25 01:24:08 UTC

[incubator-iotdb] branch fix_avg_calculation updated: format code

This is an automated email from the ASF dual-hosted git repository.

qiaojialin pushed a commit to branch fix_avg_calculation
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/fix_avg_calculation by this push:
     new b9b9ea6  format code
b9b9ea6 is described below

commit b9b9ea63d05459c2e4542ab10839d68095a5e17e
Author: qiaojialin <64...@qq.com>
AuthorDate: Tue Feb 25 09:24:23 2020 +0800

    format code
---
 .../java/org/apache/iotdb/db/query/aggregation/impl/AvgAggrResult.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/query/aggregation/impl/AvgAggrResult.java b/server/src/main/java/org/apache/iotdb/db/query/aggregation/impl/AvgAggrResult.java
index a9b9ffa..86ad7f3 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/aggregation/impl/AvgAggrResult.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/aggregation/impl/AvgAggrResult.java
@@ -116,6 +116,7 @@ public class AvgAggrResult extends AggregateResult {
   @Override
   public void merge(AggregateResult another) {
     AvgAggrResult anotherAvg = (AvgAggrResult) another;
-    avg = avg * ((double) cnt / (cnt + anotherAvg.cnt)) + anotherAvg.avg * ((double) anotherAvg.cnt / (cnt + anotherAvg.cnt));
+    avg = avg * ((double) cnt / (cnt + anotherAvg.cnt)) +
+        anotherAvg.avg * ((double) anotherAvg.cnt / (cnt + anotherAvg.cnt));
   }
 }