note
GrandFather
<blockquote><i>"initialize my $sum = 0;"</i></blockquote>
<p>An interesting variation, that is probably premature optimization in simple cases, is to:
</p>
<c>
sub average {
my $sum = shift @_;
...;
</c>
<p>For algorithms such as moving averages or integrators initializing the accumulator with the first sample value can be essential to avoiding large glitches at the start of the result data.</p>
<div class="pmsig"><div class="pmsig-461912">
Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
</div></div>
11128799
11128806