Mathematics
Algorithms
Numbers
Code
Diff
  • def average(grades)
      grades.sum.to_f / grades.size unless grades.empty?
    end 
  • 11
    def average(grades)
    
    2
      grades.sum.fdiv(grades.length)
    
    2+
      grades.sum.to_f / grades.size unless grades.empty?
    
    33
    end