Calculates the average given a series of numbers.