Skip to content

Instantly share code, notes, and snippets.

@joshuagruenstein
Created September 20, 2015 01:05
Show Gist options
  • Save joshuagruenstein/a6a645291bdd716f8726 to your computer and use it in GitHub Desktop.
Save joshuagruenstein/a6a645291bdd716f8726 to your computer and use it in GitHub Desktop.
i hate you right now
double movingAvg(double avg, double newVal, double len) {
avg -= avg/len;
avg += newVal/len;
return avg;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment