Talk:Averages/Simple moving average: Difference between revisions

→‎Numerical soundness: Not a huge issue for a simple implementation
(→‎Numerical soundness: Not a huge issue for a simple implementation)
Line 8:
::: Rosetta Code is not a code snippet repository; Code snippets shouldn't be placed here under the expectation that someone will use them ''verbatim''. Pointing out the implications of floating-point error (or any other error caused by underlying tools) as it relates to the task or problem area is well within the ''educational'' nature of the site, and is a reasonable thing to do when notice to avoid harming people who use the code without sufficiently understanding what it does. --[[User:Short Circuit|Short Circuit]] 19:36, 21 June 2009 (UTC)
:::: Of course, it's worth noting. (And by "you can't sort operands..." I meant "you can't sort all the operands, unless you store them all" of course...:D) --[[User:ShinTakezou|ShinTakezou]] 23:01, 22 June 2009 (UTC)
::::: If you're only maintaining the last <math>n</math> values, sorting isn't such a big issue and the size of the error is likely to remain small (a few ULP in the result). However, it does require keeping those <math>n</math> values around and recalculating the sum each time rather than adding and subtracting from a running total. Not very onerous for <math>n=5</math>. In fact, it's only really a problem for people who are being too clever by half… –[[User:Dkf|Donal Fellows]] 06:35, 6 February 2010 (UTC)
 
==Autohotkey takes average of all previous==
Anonymous user