Skip to content

Instantly share code, notes, and snippets.

@petershaw
Created August 13, 2014 22:49
Show Gist options
  • Save petershaw/bc4c3cf44ab1cb1c1741 to your computer and use it in GitHub Desktop.
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