benelux 0.5.11 → 0.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES.txt +8 -0
- data/benelux.gemspec +1 -1
- data/lib/benelux.rb +1 -1
- data/lib/benelux/stats.rb +7 -3
- metadata +2 -2
data/CHANGES.txt
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
BENELUX, CHANGES
|
2
2
|
|
3
|
+
#### 0.5.12 (2010-03-19) ##############################
|
4
|
+
|
5
|
+
* CHANGE: When merging Benelux::Stats::Calculator objects into one that has 0 samples,
|
6
|
+
use the values of min and max rather than averages for all.
|
7
|
+
* CHANGE: Benelux::Stats::Calculator#mean is now an alias for #avg since
|
8
|
+
we don't actual return the mean anyway (we don't keep the sample values)
|
9
|
+
|
10
|
+
|
3
11
|
#### 0.5.11 (2010-03-15) ##############################
|
4
12
|
|
5
13
|
* FIXED: Don't reset packed_methods!
|
data/benelux.gemspec
CHANGED
data/lib/benelux.rb
CHANGED
data/lib/benelux/stats.rb
CHANGED
@@ -150,7 +150,7 @@ module Benelux
|
|
150
150
|
|
151
151
|
def merge!(other)
|
152
152
|
if @sum == 0
|
153
|
-
@min
|
153
|
+
@min, @max = other.min, other.max
|
154
154
|
else
|
155
155
|
@min = other.min if other.min < @min
|
156
156
|
@max = other.max if other.max > @max
|
@@ -202,9 +202,13 @@ module Benelux
|
|
202
202
|
def to_f; mean.to_f; end
|
203
203
|
def to_i; mean.to_i; end
|
204
204
|
|
205
|
+
# NOTE: This is an alias for average. We don't store values
|
206
|
+
# so we can't return the actual mean
|
207
|
+
def mean; avg() end
|
208
|
+
def average; avg() end
|
205
209
|
# Calculates and returns the mean for the data passed so far.
|
206
|
-
def
|
207
|
-
|
210
|
+
def avg; return 0.0 unless @n > 0; @sum / @n; end
|
211
|
+
|
208
212
|
# Calculates the standard deviation of the data so far.
|
209
213
|
def sd
|
210
214
|
return 0.0 if @n <= 1
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: benelux
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Delano Mandelbaum
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-03-
|
12
|
+
date: 2010-03-19 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|