title: How to calculate moving average without keeping the count and data-total?
body: <p>I am trying to find a way to calculate a moving cumulative average without storing the count and total data that is received so far.</p>
  
  <p>I came up with two algorithms but both need to store the count:</p>
  
  <ul>
  <li>new average = ((old count * old data) + next data) / next count</li>
  <li>new average = old average + (next data - old average) / next count</li>
  </ul>
  
  <p>The problem with these methods is that the count gets bigger and bigger resulting in losing precision in the resulting average.</p>
  
  <p>The first method uses the old count and next count which are obviously 1 apart. This got me thinking that perhaps there is a way to remove the count but unfortunately I haven't found it yet. It did get me a bit further though, resulting in the second method but still count is present.</p>
  
  <p>Is it possible, or am I just searching for the impossible?</p>