Class: Array

Inherits:
Object show all
Defined in:
lib/classifier/extensions/vector.rb

Instance Method Summary collapse

Instance Method Details

#sumObject



10
11
12
# File 'lib/classifier/extensions/vector.rb', line 10

def sum
   inject(0) { |sum,term| sum += term  }.to_f
end