def avg(base = 0)
if block_given?
marry=lambda {yield}
sum(base,&marry)/size
else
0
end
#block_given? ? sum(base)yield : sum(base)
#(self.sum base yield)/size
#n=base;collect{|s|n+=yield(s)};n/size
#(block_given? ? inject(base) { |a, e| a + yield(e) } : inject(base, :+))/size
end
def avg(base = 0)
if block_given?
marry=lambda {yield}
sum(base,&marry)/size
else
0
end
#block_given? ? sum(base)yield : sum(base)
#(self.sum base yield)/size
#n=base;collect{|s|n+=yield(s)};n/size
#(block_given? ? inject(base) { |a, e| a + yield(e) } : inject(base, :+))/size
end