fast_simplify 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fast_simplify.rb +2 -2
- data/lib/fast_simplify/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: b9bc57e356353ce5aab86be92d0e84e24b9bfdc5
|
4
|
+
data.tar.gz: 98793e4ff56d50f807b141ee73799d98d8ac4664
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 724a7fc9cb575de6349152463a80c3ca2f34e754b5bef619ada4d5f23e73ec883b46e8aa7daa3732cfc72603fbc1aac4ea97c4d60d650908d714c5f2a3f7c084
|
7
|
+
data.tar.gz: cfc4a5dd7a8d8e7c7454c6bed20fac68d0bc8fc6d4c61e8bfa60df5cf70b1f491c27206a3bbaed4d760dbc5a4921df460a089c1bba3e776cbd28caf044f67b0d
|
data/lib/fast_simplify.rb
CHANGED
@@ -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|
|
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.
|
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-
|
11
|
+
date: 2016-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|