ruby-mpc 0.0.4 → 0.0.5

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.
data/.gemtest ADDED
File without changes
data/Manifest.txt CHANGED
@@ -17,5 +17,4 @@ spec/mpc/const_spec.rb
17
17
  spec/mpc/functions_spec.rb
18
18
  spec/mpc/generate_complex_number.rb
19
19
  spec/mpc/spec_helper.rb
20
- spec/spec.opts
21
20
  tasks/extconf.rake
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ $hoe = Hoe.spec 'ruby-mpc' do
14
14
  self.developer 'Takayuki YAMAGUCHI', 'd@ytak.info'
15
15
  self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
16
16
  self.rubyforge_name = self.name # TODO this is default value
17
- self.extra_deps = [['ruby-mpfr','>= 0.0.4']]
17
+ self.extra_deps = [['ruby-mpfr','>= 0.0.11']]
18
18
  self.spec_extras[:extensions] = "ext/mpc/extconf.rb"
19
19
  self.extra_rdoc_files << 'README.rdoc'
20
20
  end
data/ext/mpc/extconf.rb CHANGED
@@ -1,5 +1,19 @@
1
1
  require 'mkmf'
2
2
 
3
+ i = 0
4
+ while i < ARGV.size
5
+ case ARGV[i]
6
+ when '--ldflags'
7
+ if args = ARGV[i+1]
8
+ i += 1
9
+ $LDFLAGS += " #{args}"
10
+ end
11
+ else
12
+ raise "Invalid option: #{ARGV[i]}"
13
+ end
14
+ i += 1
15
+ end
16
+
3
17
  $CFLAGS += " -Wall"
4
18
 
5
19
  dir_config("mpfr")
data/ext/mpc/ruby_mpc.c CHANGED
@@ -255,9 +255,11 @@ static VALUE r_mpc_inspect(VALUE self)
255
255
  MPC *ptr_s;
256
256
  r_mpc_get_struct(ptr_s, self);
257
257
  char *ret_str;
258
- mpfr_asprintf(&ret_str, "#<MPC:%lx,['%.Re','%.Re'],[%d,%d]>",
259
- NUM2LONG(rb_funcall(self, object_id, 0)), mpc_realref (ptr_s), mpc_imagref (ptr_s),
260
- mpfr_get_prec(mpc_realref (ptr_s)), mpfr_get_prec(mpc_imagref (ptr_s)));
258
+ if(!mpfr_asprintf(&ret_str, "#<MPC:%lx,['%.Re','%.Re'],[%d,%d]>",
259
+ NUM2LONG(rb_funcall(self, object_id, 0)), mpc_realref (ptr_s), mpc_imagref (ptr_s),
260
+ mpfr_get_prec(mpc_realref (ptr_s)), mpfr_get_prec(mpc_imagref (ptr_s)))) {
261
+ rb_raise(rb_eFatal, "Can not allocate a string by mpfr_asprintf.");
262
+ }
261
263
  VALUE ret_val = rb_str_new2(ret_str);
262
264
  mpfr_free_str(ret_str);
263
265
  return ret_val;
data/ext/mpc/ruby_mpfr.h CHANGED
@@ -26,13 +26,19 @@ VALUE r_mpfr_class, r_mpfr_math;
26
26
  #define r_mpfr_check_non_positive_number(c_val) { if(mpfr_number_p(c_val) == 0 && mpfr_sgn(c_val) > 0) rb_raise(rb_eArgError, "Not a non positive number."); }
27
27
 
28
28
  void r_mpfr_free(void *ptr);
29
+ VALUE r_mpfr_make_new_fr_obj(MPFR *ptr);
30
+ VALUE r_mpfr_make_new_fr_obj2(MPFR *ptr, int prec);
29
31
  VALUE r_mpfr_new_fr_obj(VALUE obj);
30
32
  void r_mpfr_set_robj(MPFR *ptr, VALUE obj, mp_rnd_t rnd);
33
+ VALUE r_mpfr_robj_to_mpfr(VALUE obj, int argc, VALUE *argv);
31
34
 
32
35
  mp_rnd_t r_mpfr_rnd_from_value(VALUE rnd);
33
36
  mp_rnd_t r_mpfr_rnd_from_optional_argument(int min, int max, int argc, VALUE *argv);
34
37
  mp_rnd_t r_mpfr_prec_from_optional_argument(int min, int max, int argc, VALUE *argv);
35
38
  void r_mpfr_get_rnd_prec_from_optional_arguments(mp_rnd_t *rnd, mp_prec_t *prec, int min, int max, int argc, VALUE *argv);
36
39
 
40
+ char *r_mpfr_dump_to_string(MPFR *ptr_s);
41
+ void r_mpfr_load_string(MPFR *ptr_s, const char *dump);
42
+
37
43
  #endif /* _RUBY_MPFR_H_ */
38
44
 
data/lib/mpc/version.rb CHANGED
@@ -1 +1 @@
1
- RUBY_MPC_VERSION = '0.0.4'
1
+ RUBY_MPC_VERSION = '0.0.5'
@@ -1,9 +1,9 @@
1
1
  begin
2
- require 'spec'
2
+ require 'rspec'
3
3
  rescue LoadError
4
4
  require 'rubygems' unless ENV['NO_RUBYGEMS']
5
5
  gem 'rspec'
6
- require 'spec'
6
+ require 'rspec'
7
7
  end
8
8
 
9
9
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
data/tasks/extconf.rake CHANGED
@@ -1,18 +1,18 @@
1
- begin
2
- require 'spec'
3
- rescue LoadError
4
- require 'rubygems' unless ENV['NO_RUBYGEMS']
5
- require 'spec'
6
- end
7
- begin
8
- require 'spec/rake/spectask'
9
- rescue LoadError
10
- puts <<-EOS
11
- To use rspec for testing you must install rspec gem:
12
- gem install rspec
13
- EOS
14
- exit(0)
15
- end
1
+ # begin
2
+ # require 'spec'
3
+ # rescue LoadError
4
+ # require 'rubygems' unless ENV['NO_RUBYGEMS']
5
+ # require 'spec'
6
+ # end
7
+ # begin
8
+ # require 'spec/rake/spectask'
9
+ # rescue LoadError
10
+ # puts <<-EOS
11
+ # To use rspec for testing you must install rspec gem:
12
+ # gem install rspec
13
+ # EOS
14
+ # exit(0)
15
+ # end
16
16
 
17
17
  desc "Run 'make realclean' for extended libraries"
18
18
  task "ext:realclean" do
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-mpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ prerelease:
5
+ version: 0.0.5
5
6
  platform: ruby
6
7
  authors:
7
8
  - Takayuki YAMAGUCHI
@@ -9,49 +10,31 @@ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
12
 
12
- date: 2010-02-06 00:00:00 +09:00
13
+ date: 2011-02-26 00:00:00 +09:00
13
14
  default_executable:
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: ruby-mpfr
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 0.0.4
24
- version:
25
- - !ruby/object:Gem::Dependency
26
- name: rubyforge
27
- type: :development
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 2.0.3
34
- version:
35
- - !ruby/object:Gem::Dependency
36
- name: gemcutter
37
- type: :development
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
40
21
  requirements:
41
22
  - - ">="
42
23
  - !ruby/object:Gem::Version
43
- version: 0.3.0
44
- version:
24
+ version: 0.0.11
25
+ type: :runtime
26
+ version_requirements: *id001
45
27
  - !ruby/object:Gem::Dependency
46
28
  name: hoe
47
- type: :development
48
- version_requirement:
49
- version_requirements: !ruby/object:Gem::Requirement
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
50
32
  requirements:
51
33
  - - ">="
52
34
  - !ruby/object:Gem::Version
53
- version: 2.5.0
54
- version:
35
+ version: 2.9.1
36
+ type: :development
37
+ version_requirements: *id002
55
38
  description: |-
56
39
  ruby-mpc is an extended C library to use MPC[http://www.multiprecision.org/]
57
40
  which is the library of the arithmetic of complex numbers with multiprecision.
@@ -86,8 +69,8 @@ files:
86
69
  - spec/mpc/functions_spec.rb
87
70
  - spec/mpc/generate_complex_number.rb
88
71
  - spec/mpc/spec_helper.rb
89
- - spec/spec.opts
90
72
  - tasks/extconf.rake
73
+ - .gemtest
91
74
  has_rdoc: true
92
75
  homepage: http://rubyforge.org/projects/ruby-mpfr/
93
76
  licenses: []
@@ -98,23 +81,22 @@ rdoc_options:
98
81
  - README.rdoc
99
82
  require_paths:
100
83
  - lib
101
- - ext
102
84
  required_ruby_version: !ruby/object:Gem::Requirement
85
+ none: false
103
86
  requirements:
104
87
  - - ">="
105
88
  - !ruby/object:Gem::Version
106
89
  version: "0"
107
- version:
108
90
  required_rubygems_version: !ruby/object:Gem::Requirement
91
+ none: false
109
92
  requirements:
110
93
  - - ">="
111
94
  - !ruby/object:Gem::Version
112
95
  version: "0"
113
- version:
114
96
  requirements: []
115
97
 
116
98
  rubyforge_project: ruby-mpc
117
- rubygems_version: 1.3.5
99
+ rubygems_version: 1.5.2
118
100
  signing_key:
119
101
  specification_version: 3
120
102
  summary: ruby-mpc is an extended C library to use MPC[http://www.multiprecision.org/] which is the library of the arithmetic of complex numbers with multiprecision.
data/spec/spec.opts DELETED
@@ -1 +0,0 @@
1
- --colour