Sha256: c336da8e4b1ee527b7291207291ffd716b1c39777b79757e1c2059240c034a57
Contents?: true
Size: 362 Bytes
Versions: 40
Compression:
Stored size: 362 Bytes
Contents
require 'bigdecimal' require 'bigdecimal/util' module FeCoreExt::CoreExt end module FeCoreExt::CoreExt::Array def median return if empty? sorted = sort len = sorted.length (sorted[(len - 1) / 2] + sorted[len / 2]) / 2.0 end def mean return if empty? sum.to_d / size end end class Array include FeCoreExt::CoreExt::Array end
Version data entries
40 entries across 40 versions & 1 rubygems