Skip to content

Instantly share code, notes, and snippets.

@petershaw
Created August 13, 2014 22:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save petershaw/bc4c3cf44ab1cb1c1741 to your computer and use it in GitHub Desktop.
stream of many 11's:
while (row = this.read()) {
crunchdata.avg
= +(( crunchdata.avg
+ row.temperature ) /2).toFixed(4)
;
}
= 11
while (row = this.read()) {
crunchdata.avg
= ( crunchdata.avg
+ row.temperature ) /2)
;
}
= 10.9999999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment