public static double sum(List<Double> data) {
    double sum = 0;
    for (Double datum : data) {
      sum = sum + datum;
    }
    return sum;
  }
calculate sum of list

@param data need to calculate list
@return sum of list
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/MathUtils.java