random_bell 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/random_bell/version.rb +1 -1
- data/lib/random_bell.rb +2 -2
- data/random_bell.gemspec +1 -1
- data/spec/random_bell_spec.rb +4 -4
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8e2d2c6b448d735826d4bbfa7dab38c3ef046e7
|
4
|
+
data.tar.gz: 2ccfb6c3f429860a0501785fc0585c4d97b45b2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39671a2d895f381db1e41e2a5137e01ce12065dd40780f21814851a1eee317641bec60b0518365524a5492334730af2a9bc242b886e40ebc1483f5b06cdbb068
|
7
|
+
data.tar.gz: ba678c93052cae0515dbe6e3a0a20f8d8dc926db7ba0d54c7d7fa3ebe6c4832abf9fce29e24ace585499d4f9b5ebd6d58850c0448fd1386ddd1ceeb0a8287051
|
data/lib/random_bell/version.rb
CHANGED
data/lib/random_bell.rb
CHANGED
@@ -29,8 +29,8 @@ class RandomBell
|
|
29
29
|
numbers = (1..size).to_a.map{ rand }
|
30
30
|
|
31
31
|
klasses, klass_width = [], (@range.max - @range.min).to_f / rows
|
32
|
-
(0..rows).each_cons(2) do |
|
33
|
-
klasses << Range.new(klass_width *
|
32
|
+
(0..rows).each_cons(2) do |left, right|
|
33
|
+
klasses << Range.new(@range.min + klass_width * left, @range.min + klass_width *right)
|
34
34
|
end
|
35
35
|
|
36
36
|
divider = (klasses.map{|klass| numbers.select{|num| klass.include?(num) }.size }.max / 50.0).ceil
|
data/random_bell.gemspec
CHANGED
data/spec/random_bell_spec.rb
CHANGED
@@ -28,7 +28,7 @@ describe RandomBell do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
it "drow histgram", histogram: true do
|
31
|
-
puts @
|
31
|
+
puts @bell.to_histogram
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
@@ -58,7 +58,7 @@ describe RandomBell do
|
|
58
58
|
end
|
59
59
|
|
60
60
|
it "drow histgram", histogram: true do
|
61
|
-
puts @
|
61
|
+
puts @bell.to_histogram
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
@@ -88,7 +88,7 @@ describe RandomBell do
|
|
88
88
|
end
|
89
89
|
|
90
90
|
it "drow histgram", histogram: true do
|
91
|
-
puts @
|
91
|
+
puts @bell.to_histogram
|
92
92
|
end
|
93
93
|
end
|
94
94
|
end
|
@@ -114,7 +114,7 @@ describe RandomBell do
|
|
114
114
|
end
|
115
115
|
|
116
116
|
it "drow histgram", histogram: true do
|
117
|
-
puts @
|
117
|
+
puts @bell.to_histogram
|
118
118
|
end
|
119
119
|
end
|
120
120
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: random_bell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OSA Shunsuke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '2'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '2'
|
55
55
|
description: Normal(Gaussian) random number generator.
|
56
56
|
email:
|
57
57
|
- hhelibebcnofnenamg@gmail.com
|