Skip to content

Instantly share code, notes, and snippets.

@Stephenitis
Created February 14, 2013 08:55
Show Gist options
  • Save Stephenitis/4951430 to your computer and use it in GitHub Desktop.
Save Stephenitis/4951430 to your computer and use it in GitHub Desktop.
Exercise: Calculating the mean of an array of numbers
def mean(array)
array.reduce(:+).to_f / array.length
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment