fe_core_ext 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fe_core_ext/core_ext/array.rb +11 -0
- data/lib/fe_core_ext/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e53c97d895ae06f7c92123258f4f2afaff202608
|
4
|
+
data.tar.gz: a07fb7c8ff1f0dabe388a5d734f1967dc627a754
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9add3584fb0a05607df3cae10b79232e8ebdabf956af09d3909dcd299a2b5644e39f13e586ffefd9218d732cb51c1fab1a1f17d708bb38ae82d46de3525de9d0
|
7
|
+
data.tar.gz: dfae1712c7cc8e3ece7dac773455bbdbf7c99da0b60e7e2ec96106fc0646391e3ee522a8a099b8b04d11e33acf819dbd2a14fb1d59092375dc6e40c25ac68c51
|
@@ -1,3 +1,6 @@
|
|
1
|
+
require 'bigdecimal'
|
2
|
+
require 'bigdecimal/util'
|
3
|
+
|
1
4
|
module FeCoreExt::CoreExt
|
2
5
|
end
|
3
6
|
|
@@ -8,6 +11,14 @@ module FeCoreExt::CoreExt::Array
|
|
8
11
|
len = sorted.length
|
9
12
|
(sorted[(len - 1) / 2] + sorted[len / 2]) / 2.0
|
10
13
|
end
|
14
|
+
|
15
|
+
def sum
|
16
|
+
inject(0) { |result, el| result + el }
|
17
|
+
end
|
18
|
+
|
19
|
+
def mean
|
20
|
+
sum.to_d / size
|
21
|
+
end
|
11
22
|
end
|
12
23
|
|
13
24
|
class Array
|
data/lib/fe_core_ext/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fe_core_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tetsu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|