public static double average(double sum, double count) {
        return count > 0 ? sum / count : 0.0d;
    }
Finds r such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b < 0.
<p>
This methods returns the same value as integer modulo when
a and b are same signs, but returns a different value when
they are opposite (i.e. q is negative).
</p>
@param a dividend
@param b divisor
@return r such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b < 0
@exception IllegalArgumentException if b == 0
@since 3.4
commons/src/main/java/com/navercorp/pinpoint/common/util/MathUtils.java