Sha256: ece136df76da2f9d243bfaba9eb8814f86e02cf748663e668fa27117b059df6c
Contents?: true
Size: 359 Bytes
Versions: 15
Compression:
Stored size: 359 Bytes
Contents
module WBench class Stats < SimpleDelegator def median sort[length / 2] end def sum inject(:+) end def mean sum / length.to_f end def sample_variance (inject(0) { |variance, value| variance + ((value - mean) ** 2) }) / length end def std_dev Math.sqrt(sample_variance) end end end
Version data entries
15 entries across 15 versions & 1 rubygems