public float getMean() {
    if (n == 0) {
      return 0;
    }
    return sum / (float) n;
  }
Class to calculate the average in a stream of numbers on a continuous basis.
lottie/src/main/java/com/airbnb/lottie/utils/MeanCalculator.java