Skip to content

Instantly share code, notes, and snippets.

@peterberkenbosch
Created December 21, 2016 12:46
Show Gist options
  • Save peterberkenbosch/cd3b7be3b30634cb3e0eb2dd649d1bf9 to your computer and use it in GitHub Desktop.
Save peterberkenbosch/cd3b7be3b30634cb3e0eb2dd649d1bf9 to your computer and use it in GitHub Desktop.
set = [1.1, 1.2, 0.85, 2.0, 1.3, 3.2]
geo_avg = (set.inject{|a,b| a*b}) ** (1.0/set.size)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment