operator + method

Statistics<double> operator +(
  1. Statistics<num> other
)

Implementation

Statistics<double> operator +(Statistics other) {
  return Statistics(
    length + other.length,
    math.min(min.toDouble(), other.min.toDouble()),
    math.max(max.toDouble(), other.max.toDouble()),
    medianLow: (medianLow + other.medianLow) / 2,
    medianHigh: (medianHigh + other.medianHigh) / 2,
    sum: sum + other.sum,
    squaresSum: squaresSum + other.squaresSum,
    mean: (sum + other.sum) / (length + other.length),
    standardDeviation: _computeStandardDeviation(
        null,
        null,
        sumBigInt + other.sumBigInt,
        squaresSumBigInt + other.squaresSumBigInt,
        length + other.length),
  );
}