Manual Reference Pages - DATA::AVERAGE::BOUNDED (3)
Data::Average::Bounded - Data::Average With Bounded
my $data = Data::Average::Bounded->new(max => 10);
$data->add($_) for (1..100);
print $data->avg; # 95 (avg of 90 .. 100)
Data::Average::Bounded is a bounded version of Data::Average, which keeps
the data size to a predefined size.
new(max => CW$max)
Creates a new Data::Average::Bounded object, bounded by $max.
Adds a value to the Data::Average::Bounded set. If the data size exceeds the
length specified by max given to the constructor, old elements are popped
out of the set to keep the data size.
$value may either be an object that implements a method value() which
returns a numerical representation of the object, or a simple scalar.
Same as Data::Average.
Copyright (c) 2006 Daisuke Maki <email@example.com>
All rights reserved.
|perl v5.20.3 ||DATA::AVERAGE::BOUNDED (3) ||2007-11-14 |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.