Raises:
42 43 44 45 46
# File 'lib/rust/stats/descriptive.rb', line 42 def sum(data) raise TypeError, "Expecting Array of numerics" if !data.is_a?(Array) || !data.all? { |e| e.is_a?(Numeric) } return data.sum end