rstat 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/README.md +7 -0
- data/lib/rstat/core_ext/array.rb +1 -0
- data/lib/rstat/core_ext/array/standard_deviation.rb +15 -0
- data/lib/rstat/version.rb +1 -1
- data/spec/rstat/array_spec.rb +10 -0
- metadata +5 -4
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/lib/rstat/core_ext/array.rb
CHANGED
data/lib/rstat/version.rb
CHANGED
data/spec/rstat/array_spec.rb
CHANGED
@@ -74,4 +74,14 @@ describe Rstat do
|
|
74
74
|
[44, 45, 46, 44, 46, 50].mode.should eql([44, 46])
|
75
75
|
end
|
76
76
|
end
|
77
|
+
|
78
|
+
describe ".standard_deviation" do
|
79
|
+
it "calculates the variance of an array" do
|
80
|
+
[1, 2, 3, 4, 5, 6].variance.should be_within(0.00001).of(2.91667)
|
81
|
+
end
|
82
|
+
|
83
|
+
it "calculates the standard deviation of an array" do
|
84
|
+
[1, 2, 3, 4, 5, 6].standard_deviation.should be_within(0.00001).of(1.70783)
|
85
|
+
end
|
86
|
+
end
|
77
87
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rstat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sean Eshbaugh
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-03-
|
18
|
+
date: 2012-03-27 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- lib/rstat/core_ext/array/mean.rb
|
54
54
|
- lib/rstat/core_ext/array/median.rb
|
55
55
|
- lib/rstat/core_ext/array/mode.rb
|
56
|
+
- lib/rstat/core_ext/array/standard_deviation.rb
|
56
57
|
- lib/rstat/version.rb
|
57
58
|
- rstat.gemspec
|
58
59
|
- spec/rstat/array_spec.rb
|