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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c23d32b11d0cb1f433c5c053b949bf6aac1014d0
4
- data.tar.gz: 5f88eae9f7ed8166d52349bb25babce1224a1ccd
3
+ metadata.gz: e53c97d895ae06f7c92123258f4f2afaff202608
4
+ data.tar.gz: a07fb7c8ff1f0dabe388a5d734f1967dc627a754
5
5
  SHA512:
6
- metadata.gz: 17182cb4ad7969bc4c0b545f8acb7a3827f335515d15ec589ca000d166dea1756cd4aa89b340515b500e385bdad9bdf91bece1fc16c2129c06e9dee54b47cb99
7
- data.tar.gz: 187586d0d814b7517d3e57e62d8e1de933917dce89fc5ada22758e0d27c1a8bc8658bd1dfbcf03e174514183042b073aab5c5a96d02b659255ed342c9e3c5e99
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
@@ -1,3 +1,3 @@
1
1
  module FeCoreExt
2
- VERSION = '0.1.11'
2
+ VERSION = '0.1.12'
3
3
  end
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.11
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-06 00:00:00.000000000 Z
11
+ date: 2016-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler