Sha256: dcf955b12a6597fcf5d45c990086968dee7fc3d1de2d4aeb36c1dd465405051c
Contents?: true
Size: 276 Bytes
Versions: 4
Compression:
Stored size: 276 Bytes
Contents
class Array def median unless self.length == 0 copy = self.sort if copy.length % 2 == 0 (copy[copy.length / 2 - 1] + copy[copy.length / 2]) / 2.0 else copy[copy.length / 2] end else nil end end end
Version data entries
4 entries across 4 versions & 1 rubygems