- or download this
foreach my $i ($#$arr)
{
$avg = ($i + ($avg ? $avg : $i)) / 2;
}
- or download this
$avg = (...(($arr->[0]/2 + $arr->[1])/2 + $arr->[2])/2 + ... $arr->[$#
+$arr])/2;
- or download this
my @x = (10, 7, 5, 10, 50, 70, 75, 72, 79, 80);
...
7: 20.3359375
10: 13.66796875
11.833984375
- or download this
my @x = (10, 7, 5, 10, 50, 70, 75, 72, 79, 80);
...
7: 441
10: 448
45.8