Created
September 9, 2014 01:50
-
-
Save stochastic-thread/e23ebe8fd0daa12f626d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class Array | |
def avg | |
self.inject(:+).fdiv(self.length) | |
end | |
end | |
g = [5,4,6,5,5,6,7,6,4,234234,2,4,4,3,43] | |
puts g.avg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shit I can't run code? Whats the point of gists then... this is stupid