fast_simplify 0.3.0 → 0.4.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4ac90e458559a7964a8680cc5eae0d7f177518a
4
- data.tar.gz: 2eef72df313bf0cde13235dd50734b9acef5aba3
3
+ metadata.gz: b9bc57e356353ce5aab86be92d0e84e24b9bfdc5
4
+ data.tar.gz: 98793e4ff56d50f807b141ee73799d98d8ac4664
5
5
  SHA512:
6
- metadata.gz: 71aa8e4c5bacd3f7326042857829b731c7e4ea70f6093bd201662dff912d4b6d08cf83164acb0375ef6673e68d7edafb3878b62683e3743df76642577d77a5c8
7
- data.tar.gz: 1c9d73fa84f6e3233a5daf8989b85a6acf5152f4260df82e824a027a4e2657149435bb0be2a3e1a3bd7b1993e7c7dacf9c6b94188867feaf5982123ca35bbb9c
6
+ metadata.gz: 724a7fc9cb575de6349152463a80c3ca2f34e754b5bef619ada4d5f23e73ec883b46e8aa7daa3732cfc72603fbc1aac4ea97c4d60d650908d714c5f2a3f7c084
7
+ data.tar.gz: cfc4a5dd7a8d8e7c7454c6bed20fac68d0bc8fc6d4c61e8bfa60df5cf70b1f491c27206a3bbaed4d760dbc5a4921df460a089c1bba3e776cbd28caf044f67b0d
@@ -6,9 +6,9 @@ module FastSimplify
6
6
  return array if len <= 2 || rate == 1
7
7
  return [array[0], array[-1]] if rate == 0
8
8
 
9
- result_count = len * rate
9
+ result_count = (len * rate).round
10
10
  max_index = len - 1
11
- step = max_index / (result_count - 1)
11
+ step = max_index / (result_count - 1).to_f
12
12
 
13
13
  result = []
14
14
  0.step(max_index, step) do |n|
@@ -1,3 +1,3 @@
1
1
  module FastSimplify
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_simplify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - yama@muteki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-30 00:00:00.000000000 Z
11
+ date: 2016-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler