continued_fractions 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/README.txt +16 -16
- data/Rakefile +2 -1
- data/continued_fractions.gemspec +2 -2
- metadata +3 -3
data/History.txt
CHANGED
data/README.txt
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
= ContinuedFractions
|
2
2
|
|
3
|
-
*
|
3
|
+
* http://rubygems.org/gems/continued_fractions
|
4
4
|
|
5
|
-
==
|
5
|
+
== Description:
|
6
6
|
|
7
7
|
Generates quotients and convergents for a given number.
|
8
8
|
|
9
|
-
==
|
9
|
+
== Features/Problems:
|
10
10
|
|
11
11
|
* Requires Ruby 1.9+
|
12
12
|
* Depends on Ruby 1.9's Rational class
|
13
13
|
|
14
|
-
==
|
14
|
+
== Synopsis:
|
15
15
|
|
16
|
-
require 'continued_fractions'
|
16
|
+
require 'continued_fractions'<br/>
|
17
17
|
include ContinuedFractions
|
18
18
|
|
19
|
-
frac = Rational(3,2)
|
20
|
-
real = Math.log2(ratio.to_f)
|
21
|
-
cf = ContinuedFraction.new(real,10)
|
22
|
-
=> #<ContinuedFractions::ContinuedFraction:0x000001009d1d00 @number=0.584962500721156, @limit=10, @quotients=[0, 1, 1, 2, 2, 3, 1, 5, 2, 23], @convergents=[[0, 1], [1, 0], [0, 1], [1, 1], [1, 2], [3, 5], [7, 12], [24, 41], [31, 53], [179, 306], [389, 665], [9126, 15601]]>
|
23
|
-
|
19
|
+
frac = Rational(3,2)<br/>
|
20
|
+
real = Math.log2(ratio.to_f)<br/>
|
21
|
+
cf = ContinuedFraction.new(real,10)<br/>
|
24
22
|
cf.convergents
|
25
|
-
|
23
|
+
|
24
|
+
> [(0/1), (1/1), (1/2), (3/5), (7/12), (24/41), (31/53), (179/306), (389/665), (9126/15601)]
|
26
25
|
|
27
26
|
cf.convergent(4)
|
28
|
-
=> (7/12)
|
29
27
|
|
30
|
-
|
28
|
+
> (7/12)
|
29
|
+
|
30
|
+
== Requirements:
|
31
31
|
|
32
32
|
* Ruby 1.9+
|
33
33
|
|
34
|
-
==
|
34
|
+
== Install:
|
35
35
|
|
36
36
|
sudo gem install continued_fractions
|
37
37
|
|
38
|
-
==
|
38
|
+
== Developers:
|
39
39
|
|
40
40
|
After checking out the source, run:
|
41
41
|
|
@@ -44,7 +44,7 @@ After checking out the source, run:
|
|
44
44
|
This task will install any missing dependencies, run the tests/specs,
|
45
45
|
and generate the RDoc.
|
46
46
|
|
47
|
-
==
|
47
|
+
== License:
|
48
48
|
|
49
49
|
(The MIT License)
|
50
50
|
|
data/Rakefile
CHANGED
@@ -2,9 +2,10 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('continued_fractions', '0.1.
|
5
|
+
Echoe.new('continued_fractions', '0.1.2') do |config|
|
6
6
|
config.description = 'Generate continued fractions.'
|
7
7
|
config.author = 'Jose Hales-Garcia'
|
8
|
+
config.url = 'http://rubygems.org/gems/continued_fractions'
|
8
9
|
config.email = 'jolohaga@me.com'
|
9
10
|
config.ignore_pattern = ["tmp/*",".hg/*"]
|
10
11
|
config.development_dependencies = []
|
data/continued_fractions.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{continued_fractions}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.2"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Jose Hales-Garcia"]
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.email = %q{jolohaga@me.com}
|
12
12
|
s.extra_rdoc_files = ["README.txt", "lib/continued_fractions.rb"]
|
13
13
|
s.files = ["History.txt", "Manifest", "README.txt", "Rakefile", "lib/continued_fractions.rb", "continued_fractions.gemspec"]
|
14
|
-
s.homepage = %q{}
|
14
|
+
s.homepage = %q{http://rubygems.org/gems/continued_fractions}
|
15
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Continued_fractions", "--main", "README.txt"]
|
16
16
|
s.require_paths = ["lib"]
|
17
17
|
s.rubyforge_project = %q{continued_fractions}
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jose Hales-Garcia
|
@@ -35,7 +35,7 @@ files:
|
|
35
35
|
- lib/continued_fractions.rb
|
36
36
|
- continued_fractions.gemspec
|
37
37
|
has_rdoc: true
|
38
|
-
homepage:
|
38
|
+
homepage: http://rubygems.org/gems/continued_fractions
|
39
39
|
licenses: []
|
40
40
|
|
41
41
|
post_install_message:
|