Sha256: 3180fd8ae585073a650236280d76cffec1b4b5458add28a1af7675383bb929d3
Contents?: true
Size: 322 Bytes
Versions: 7
Compression:
Stored size: 322 Bytes
Contents
class Array # # Returns the element at the position closest to the given # percentile. For example, sorted_percentile 0.0 will return the # first element and sorted_percentile 100.0 will return the last # element. # def sorted_percentile percentile return self[(size - 1) * percentile / 100.0] end end
Version data entries
7 entries across 7 versions & 1 rubygems