gmp 0.4.7-x86-mingw32 → 0.5.3-x86-mingw32
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/CHANGELOG +31 -0
- data/README.rdoc +16 -8
- data/benchmark/gexpr +0 -0
- data/benchmark/multiply +1 -1
- data/benchmark/multiply.gc +57 -0
- data/benchmark/pi +126 -0
- data/benchmark/srb.sh +21 -0
- data/ext/extconf.rb +3 -0
- data/ext/gmp.c +16 -7
- data/ext/gmp.so +0 -0
- data/ext/gmpbench_timing.c +1 -1
- data/ext/gmpf.c +445 -104
- data/ext/gmpq.c +25 -17
- data/ext/gmpz.c +232 -120
- data/ext/libmpfr-4.dll +0 -0
- data/ext/mprnd.c +23 -5
- data/ext/ruby_gmp.h +75 -9
- data/lib/gmp.rb +9 -0
- data/manual.pdf +0 -0
- data/manual.tex +494 -60
- data/test/README +1 -0
- data/test/mpfr_tcbrt.rb +95 -0
- data/test/mpfr_tisnan.rb +70 -0
- data/test/mpfr_trec_sqrt.rb +62 -0
- data/test/mpfr_tsqrt.rb +142 -6
- data/test/tc_cmp.rb +4 -4
- data/test/tc_constants.rb +10 -0
- data/test/tc_division.rb +13 -2
- data/test/tc_f_arithmetics_coersion.rb +2 -2
- data/test/tc_f_precision.rb +4 -3
- data/test/tc_fib_fac_nextprime.rb +2 -2
- data/test/tc_floor_ceil_truncate.rb +2 -2
- data/test/tc_hashes.rb +0 -2
- data/test/tc_logical_roots.rb +1 -3
- data/test/tc_mpfr_constants.rb +11 -0
- data/test/tc_mpfr_functions.rb +22 -9
- data/test/tc_mpfr_random.rb +1 -3
- data/test/tc_mpfr_rounding.rb +10 -7
- data/test/tc_q.rb +1 -3
- data/test/tc_q_basic.rb +3 -5
- data/test/tc_random.rb +1 -3
- data/test/tc_sgn_neg_abs.rb +1 -3
- data/test/tc_swap.rb +1 -3
- data/test/tc_z.rb +3 -3
- data/test/tc_z_addmul.rb +92 -0
- data/test/tc_z_basic.rb +6 -8
- data/test/tc_z_exponentiation.rb +1 -3
- data/test/tc_z_gcd_lcm_invert.rb +1 -3
- data/test/tc_z_jac_leg_rem.rb +1 -3
- data/test/tc_z_logic.rb +2 -2
- data/test/tc_z_shifts_last_bits.rb +2 -2
- data/test/tc_z_to_d_to_i.rb +2 -2
- data/test/test_helper.rb +1 -1
- data/test/test_unit/assertions.rb +31 -0
- data/test/unit_tests.rb +33 -27
- metadata +35 -8
data/test/tc_z_exponentiation.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
1
|
class TC_Z_Exponentiation < Test::Unit::TestCase
|
4
2
|
def setup
|
5
3
|
@a = GMP::Z.new(100)
|
@@ -19,4 +17,4 @@ class TC_Z_Exponentiation < Test::Unit::TestCase
|
|
19
17
|
assert_equal(GMP::Z(0), @a.powmod(@b,256), "(a : GMP::Z).powmod((b : GMP::Z), (c : Fixnum)) should work correctly")
|
20
18
|
assert_equal(GMP::Z(0), @a.powmod(@b,@c), "(a : GMP::Z).powmod((b : GMP::Z), (c : GMP::Z)) should work correctly")
|
21
19
|
end
|
22
|
-
end
|
20
|
+
end
|
data/test/tc_z_gcd_lcm_invert.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
1
|
class TC_Z_GCD_LCM_Invert < Test::Unit::TestCase
|
4
2
|
def setup
|
5
3
|
@a = GMP::Z( 24) # 2^3 * 3
|
@@ -54,4 +52,4 @@ class TC_Z_GCD_LCM_Invert < Test::Unit::TestCase
|
|
54
52
|
assert_equal(GMP::Z( 4), GMP::Z(14).invert(@e), "GMP::Z should invert correctly")
|
55
53
|
assert_equal(GMP::Z( 3), GMP::Z(15).invert(@e), "GMP::Z should invert correctly")
|
56
54
|
end
|
57
|
-
end
|
55
|
+
end
|
data/test/tc_z_jac_leg_rem.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
1
|
class TC_Z_Jacobi_Legendre_Remove < Test::Unit::TestCase
|
4
2
|
def setup
|
5
3
|
@one = GMP::Z(1)
|
@@ -70,4 +68,4 @@ class TC_Z_Jacobi_Legendre_Remove < Test::Unit::TestCase
|
|
70
68
|
assert_equal(1, @forty_five.remove(@five)[1], "GMP::Z should remove(GMP::Z) correctly.")
|
71
69
|
assert_equal(2, @forty_five.remove(@three)[1], "GMP::Z should remove(GMP::Z) correctly.")
|
72
70
|
end
|
73
|
-
end
|
71
|
+
end
|
data/test/tc_z_logic.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'test_helper'
|
1
|
+
require './test_helper'
|
2
2
|
|
3
3
|
class TC_shifts_last_bits < Test::Unit::TestCase
|
4
4
|
def setup
|
@@ -19,4 +19,4 @@ class TC_shifts_last_bits < Test::Unit::TestCase
|
|
19
19
|
#assert_equal(-4, @b.lastbits_sgn(5), "GMP::Z should lastbits_sgn correctly.")
|
20
20
|
# a.tshr 5 ???
|
21
21
|
end
|
22
|
-
end
|
22
|
+
end
|
data/test/tc_z_to_d_to_i.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'test_helper'
|
1
|
+
require './test_helper'
|
2
2
|
|
3
3
|
class TC_to_i_to_d < Test::Unit::TestCase
|
4
4
|
def setup
|
@@ -21,4 +21,4 @@ class TC_to_i_to_d < Test::Unit::TestCase
|
|
21
21
|
#assert_equal(@b.to_d.class, Float, "GMP::Z.to_d should be a Float.")
|
22
22
|
assert_equal(@c.to_d.class, Float, "GMP::Q.to_d should be a Float.")
|
23
23
|
end
|
24
|
-
end
|
24
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
module Test::Unit::Assertions
|
2
|
+
def assert_less_than(expected, actual, message=nil)
|
3
|
+
assert_true(actual < expected, message)
|
4
|
+
end
|
5
|
+
alias :assert_lt :assert_less_than
|
6
|
+
|
7
|
+
def assert_lte(expected, actual, message=nil)
|
8
|
+
assert_true(actual <= expected, message)
|
9
|
+
end
|
10
|
+
|
11
|
+
def assert_greater_than(expected, actual, message=nil)
|
12
|
+
assert_true(actual > expected, message)
|
13
|
+
end
|
14
|
+
alias :assert_gt :assert_greater_than
|
15
|
+
|
16
|
+
def assert_gte(expected, actual, message=nil)
|
17
|
+
assert_true(actual >= expected, message)
|
18
|
+
end
|
19
|
+
|
20
|
+
def assert_between(expected_low, expected_high, actual, message=nil)
|
21
|
+
assert_true(actual <= expected_high && actual >= expected_low, message)
|
22
|
+
end
|
23
|
+
|
24
|
+
def assert_true(actual, message=nil)
|
25
|
+
assert(actual, message)
|
26
|
+
end
|
27
|
+
|
28
|
+
def assert_false(actual, message=nil)
|
29
|
+
assert(!actual, message)
|
30
|
+
end
|
31
|
+
end
|
data/test/unit_tests.rb
CHANGED
@@ -1,36 +1,42 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require 'test_helper'
|
3
|
+
require './test_helper'
|
4
4
|
|
5
|
-
require '
|
6
|
-
require '
|
7
|
-
require '
|
8
|
-
require '
|
9
|
-
require '
|
10
|
-
require '
|
11
|
-
require '
|
12
|
-
require '
|
13
|
-
require '
|
14
|
-
require '
|
15
|
-
require '
|
16
|
-
require '
|
17
|
-
require '
|
18
|
-
require '
|
19
|
-
require '
|
20
|
-
require '
|
21
|
-
require '
|
22
|
-
require '
|
23
|
-
require '
|
24
|
-
require '
|
25
|
-
require '
|
26
|
-
require '
|
5
|
+
require './tc_constants'
|
6
|
+
require './tc_z'
|
7
|
+
require './tc_z_basic'
|
8
|
+
require './tc_z_addmul'
|
9
|
+
require './tc_z_logic'
|
10
|
+
require './tc_q'
|
11
|
+
require './tc_cmp'
|
12
|
+
require './tc_q_basic'
|
13
|
+
require './tc_z_exponentiation'
|
14
|
+
require './tc_zerodivisionexceptions'
|
15
|
+
require './tc_sgn_neg_abs'
|
16
|
+
require './tc_fib_fac_nextprime'
|
17
|
+
require './tc_swap'
|
18
|
+
require './tc_floor_ceil_truncate'
|
19
|
+
require './tc_z_to_d_to_i'
|
20
|
+
require './tc_z_shifts_last_bits'
|
21
|
+
require './tc_logical_roots'
|
22
|
+
require './tc_f_precision'
|
23
|
+
require './tc_f_arithmetics_coersion'
|
24
|
+
require './tc_division'
|
25
|
+
require './tc_z_jac_leg_rem'
|
26
|
+
require './tc_z_gcd_lcm_invert'
|
27
|
+
require './tc_random'
|
28
|
+
require './tc_hashes'
|
27
29
|
|
28
30
|
begin
|
29
31
|
GMP::MPFR_VERSION
|
30
|
-
require '
|
31
|
-
require '
|
32
|
-
require '
|
33
|
-
require '
|
32
|
+
require './tc_mpfr_constants'
|
33
|
+
require './tc_mpfr_random'
|
34
|
+
require './tc_mpfr_functions'
|
35
|
+
require './tc_mpfr_rounding'
|
36
|
+
require './mpfr_tcbrt'
|
37
|
+
require './mpfr_tisnan'
|
38
|
+
require './mpfr_trec_sqrt'
|
39
|
+
require './mpfr_tsqrt'
|
34
40
|
rescue
|
35
41
|
|
36
42
|
end
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gmp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 13
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 5
|
9
|
+
- 3
|
10
|
+
version: 0.5.3
|
5
11
|
platform: x86-mingw32
|
6
12
|
authors:
|
7
13
|
- Tomasz Wegrzanowski
|
@@ -10,7 +16,7 @@ autorequire:
|
|
10
16
|
bindir: bin
|
11
17
|
cert_chain: []
|
12
18
|
|
13
|
-
date: 2010-
|
19
|
+
date: 2010-09-20 00:00:00 -07:00
|
14
20
|
default_executable:
|
15
21
|
dependencies: []
|
16
22
|
|
@@ -20,8 +26,8 @@ email:
|
|
20
26
|
- sam.rawlins@gmail.com
|
21
27
|
executables: []
|
22
28
|
|
23
|
-
extensions:
|
24
|
-
|
29
|
+
extensions: []
|
30
|
+
|
25
31
|
extra_rdoc_files: []
|
26
32
|
|
27
33
|
files:
|
@@ -39,11 +45,17 @@ files:
|
|
39
45
|
- ext/ruby_gmp.h
|
40
46
|
- ext/takeover.h
|
41
47
|
- ext/extconf.rb
|
48
|
+
- lib/gmp.rb
|
42
49
|
- ext/libgmp-10.dll
|
43
50
|
- ext/libmpfr-1.dll
|
51
|
+
- ext/libmpfr-4.dll
|
44
52
|
- ext/gmp.so
|
53
|
+
- test/mpfr_tcbrt.rb
|
54
|
+
- test/mpfr_tisnan.rb
|
55
|
+
- test/mpfr_trec_sqrt.rb
|
45
56
|
- test/mpfr_tsqrt.rb
|
46
57
|
- test/tc_cmp.rb
|
58
|
+
- test/tc_constants.rb
|
47
59
|
- test/tc_division.rb
|
48
60
|
- test/tc_fib_fac_nextprime.rb
|
49
61
|
- test/tc_floor_ceil_truncate.rb
|
@@ -51,6 +63,7 @@ files:
|
|
51
63
|
- test/tc_f_precision.rb
|
52
64
|
- test/tc_hashes.rb
|
53
65
|
- test/tc_logical_roots.rb
|
66
|
+
- test/tc_mpfr_constants.rb
|
54
67
|
- test/tc_mpfr_functions.rb
|
55
68
|
- test/tc_mpfr_random.rb
|
56
69
|
- test/tc_mpfr_rounding.rb
|
@@ -61,6 +74,7 @@ files:
|
|
61
74
|
- test/tc_swap.rb
|
62
75
|
- test/tc_z.rb
|
63
76
|
- test/tc_zerodivisionexceptions.rb
|
77
|
+
- test/tc_z_addmul.rb
|
64
78
|
- test/tc_z_basic.rb
|
65
79
|
- test/tc_z_exponentiation.rb
|
66
80
|
- test/tc_z_gcd_lcm_invert.rb
|
@@ -77,16 +91,21 @@ files:
|
|
77
91
|
- test/test_helper.rb
|
78
92
|
- test/unit_tests.rb
|
79
93
|
- test/README
|
94
|
+
- test/test_unit/assertions.rb
|
80
95
|
- benchmark/COPYING
|
81
96
|
- benchmark/divide
|
82
97
|
- benchmark/gcd
|
98
|
+
- benchmark/gexpr
|
83
99
|
- benchmark/gexpr.c
|
84
100
|
- benchmark/gexpr.exe
|
85
101
|
- benchmark/multiply
|
102
|
+
- benchmark/multiply.gc
|
103
|
+
- benchmark/pi
|
86
104
|
- benchmark/README
|
87
105
|
- benchmark/rsa
|
88
106
|
- benchmark/runbench
|
89
107
|
- benchmark/runbench.rb
|
108
|
+
- benchmark/srb.sh
|
90
109
|
- benchmark/version
|
91
110
|
- CHANGELOG
|
92
111
|
- INSTALL
|
@@ -103,21 +122,29 @@ rdoc_options: []
|
|
103
122
|
require_paths:
|
104
123
|
- lib
|
105
124
|
required_ruby_version: !ruby/object:Gem::Requirement
|
125
|
+
none: false
|
106
126
|
requirements:
|
107
127
|
- - ">="
|
108
128
|
- !ruby/object:Gem::Version
|
109
|
-
|
110
|
-
|
129
|
+
hash: 59
|
130
|
+
segments:
|
131
|
+
- 1
|
132
|
+
- 8
|
133
|
+
- 6
|
134
|
+
version: 1.8.6
|
111
135
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
|
+
none: false
|
112
137
|
requirements:
|
113
138
|
- - ">="
|
114
139
|
- !ruby/object:Gem::Version
|
140
|
+
hash: 3
|
141
|
+
segments:
|
142
|
+
- 0
|
115
143
|
version: "0"
|
116
|
-
version:
|
117
144
|
requirements:
|
118
145
|
- GMP compiled and working properly.
|
119
146
|
rubyforge_project:
|
120
|
-
rubygems_version: 1.3.
|
147
|
+
rubygems_version: 1.3.7
|
121
148
|
signing_key:
|
122
149
|
specification_version: 3
|
123
150
|
summary: Provides Ruby bindings to the GMP library.
|