here is my code:
def mean(n)
s=0
m=0
self.each{|item|
if item>n then
puts item
s=s+n
m=m+1
else
end}
return s/(m.to_f)
end
here is output
[1,2,3,4].mean(2)
=> 2.0
why i can't get
[1,2,3,4].mean(2)
=> 3.5
-- 
Posted via http://www.ruby-forum.com/.