.NET Framework 3.5. I\'m trying to calculate the average of some pretty large numbers. For instance:
using System; using System.Linq; class Program {
Let Avg(n) be the average in first n number, and data[n] is the nth number.
Avg(n)=(double)(n-1)/(double)n*Avg(n-1)+(double)data[n]/(double)n
Can avoid value overflow however loss precision when n is very large.