mtrc 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mtrc/sorted_samples.rb +6 -1
- data/lib/mtrc/version.rb +1 -1
- metadata +1 -1
data/lib/mtrc/sorted_samples.rb
CHANGED
@@ -44,7 +44,12 @@ class Mtrc::SortedSamples < Mtrc::Samples
|
|
44
44
|
# Returns the sample at probrotion f of the list. For example, at(.95) is
|
45
45
|
# the 95th percentile value.
|
46
46
|
def at(f)
|
47
|
-
|
47
|
+
i = (f * @ns.size).floor
|
48
|
+
if i == @ns.size
|
49
|
+
@ns[i - 1]
|
50
|
+
else
|
51
|
+
@ns[i]
|
52
|
+
end
|
48
53
|
end
|
49
54
|
|
50
55
|
def clear
|
data/lib/mtrc/version.rb
CHANGED