* transcode_data.h (rb_transcoder): add resetstate_func field for
[ruby-svn.git] / test / ruby / test_rational2.rb
blob641bfea56522e0a7f53359b812b58460f06c712f
1 require 'test/unit'
3 class Rational_Test2 < Test::Unit::TestCase
5   def test_kumi
6     assert_equal(Rational(2, 1),
7                  Rational(1, 1) + Rational(1, 1))
8     assert_equal(Rational(0, 1),
9                  Rational(1, 1) - Rational(1, 1))
10     assert_equal(Rational(1, 1),
11                  Rational(1, 1) * Rational(1, 1))
12     assert_equal(Rational(1, 1),
13                  Rational(1, 1) / Rational(1, 1))
14     assert_equal(Rational(3, 1),
15                  Rational(1, 1) + Rational(2, 1))
16     assert_equal(Rational(-1, 1),
17                  Rational(1, 1) - Rational(2, 1))
18     assert_equal(Rational(2, 1),
19                  Rational(1, 1) * Rational(2, 1))
20     assert_equal(Rational(1, 2),
21                  Rational(1, 1) / Rational(2, 1))
22     assert_equal(Rational(4, 1),
23                  Rational(1, 1) + Rational(3, 1))
24     assert_equal(Rational(-2, 1),
25                  Rational(1, 1) - Rational(3, 1))
26     assert_equal(Rational(3, 1),
27                  Rational(1, 1) * Rational(3, 1))
28     assert_equal(Rational(1, 3),
29                  Rational(1, 1) / Rational(3, 1))
30     assert_equal(Rational(1073741790, 1),
31                  Rational(1, 1) + Rational(1073741789, 1))
32     assert_equal(Rational(-1073741788, 1),
33                  Rational(1, 1) - Rational(1073741789, 1))
34     assert_equal(Rational(1073741789, 1),
35                  Rational(1, 1) * Rational(1073741789, 1))
36     assert_equal(Rational(1, 1073741789),
37                  Rational(1, 1) / Rational(1073741789, 1))
38     assert_equal(Rational(1073741828, 1),
39                  Rational(1, 1) + Rational(1073741827, 1))
40     assert_equal(Rational(-1073741826, 1),
41                  Rational(1, 1) - Rational(1073741827, 1))
42     assert_equal(Rational(1073741827, 1),
43                  Rational(1, 1) * Rational(1073741827, 1))
44     assert_equal(Rational(1, 1073741827),
45                  Rational(1, 1) / Rational(1073741827, 1))
46     assert_equal(Rational(5, 3),
47                  Rational(1, 1) + Rational(2, 3))
48     assert_equal(Rational(1, 3),
49                  Rational(1, 1) - Rational(2, 3))
50     assert_equal(Rational(2, 3),
51                  Rational(1, 1) * Rational(2, 3))
52     assert_equal(Rational(3, 2),
53                  Rational(1, 1) / Rational(2, 3))
54     assert_equal(Rational(5, 2),
55                  Rational(1, 1) + Rational(3, 2))
56     assert_equal(Rational(-1, 2),
57                  Rational(1, 1) - Rational(3, 2))
58     assert_equal(Rational(3, 2),
59                  Rational(1, 1) * Rational(3, 2))
60     assert_equal(Rational(2, 3),
61                  Rational(1, 1) / Rational(3, 2))
62     assert_equal(Rational(1073741792, 1073741789),
63                  Rational(1, 1) + Rational(3, 1073741789))
64     assert_equal(Rational(1073741786, 1073741789),
65                  Rational(1, 1) - Rational(3, 1073741789))
66     assert_equal(Rational(3, 1073741789),
67                  Rational(1, 1) * Rational(3, 1073741789))
68     assert_equal(Rational(1073741789, 3),
69                  Rational(1, 1) / Rational(3, 1073741789))
70     assert_equal(Rational(1073741792, 3),
71                  Rational(1, 1) + Rational(1073741789, 3))
72     assert_equal(Rational(-1073741786, 3),
73                  Rational(1, 1) - Rational(1073741789, 3))
74     assert_equal(Rational(1073741789, 3),
75                  Rational(1, 1) * Rational(1073741789, 3))
76     assert_equal(Rational(3, 1073741789),
77                  Rational(1, 1) / Rational(1073741789, 3))
78     assert_equal(Rational(1073741830, 1073741827),
79                  Rational(1, 1) + Rational(3, 1073741827))
80     assert_equal(Rational(1073741824, 1073741827),
81                  Rational(1, 1) - Rational(3, 1073741827))
82     assert_equal(Rational(3, 1073741827),
83                  Rational(1, 1) * Rational(3, 1073741827))
84     assert_equal(Rational(1073741827, 3),
85                  Rational(1, 1) / Rational(3, 1073741827))
86     assert_equal(Rational(1073741830, 3),
87                  Rational(1, 1) + Rational(1073741827, 3))
88     assert_equal(Rational(-1073741824, 3),
89                  Rational(1, 1) - Rational(1073741827, 3))
90     assert_equal(Rational(1073741827, 3),
91                  Rational(1, 1) * Rational(1073741827, 3))
92     assert_equal(Rational(3, 1073741827),
93                  Rational(1, 1) / Rational(1073741827, 3))
94     assert_equal(Rational(2147483616, 1073741827),
95                  Rational(1, 1) + Rational(1073741789, 1073741827))
96     assert_equal(Rational(38, 1073741827),
97                  Rational(1, 1) - Rational(1073741789, 1073741827))
98     assert_equal(Rational(1073741789, 1073741827),
99                  Rational(1, 1) * Rational(1073741789, 1073741827))
100     assert_equal(Rational(1073741827, 1073741789),
101                  Rational(1, 1) / Rational(1073741789, 1073741827))
102     assert_equal(Rational(2147483616, 1073741789),
103                  Rational(1, 1) + Rational(1073741827, 1073741789))
104     assert_equal(Rational(-38, 1073741789),
105                  Rational(1, 1) - Rational(1073741827, 1073741789))
106     assert_equal(Rational(1073741827, 1073741789),
107                  Rational(1, 1) * Rational(1073741827, 1073741789))
108     assert_equal(Rational(1073741789, 1073741827),
109                  Rational(1, 1) / Rational(1073741827, 1073741789))
110     assert_equal(Rational(3, 1),
111                  Rational(2, 1) + Rational(1, 1))
112     assert_equal(Rational(1, 1),
113                  Rational(2, 1) - Rational(1, 1))
114     assert_equal(Rational(2, 1),
115                  Rational(2, 1) * Rational(1, 1))
116     assert_equal(Rational(2, 1),
117                  Rational(2, 1) / Rational(1, 1))
118     assert_equal(Rational(4, 1),
119                  Rational(2, 1) + Rational(2, 1))
120     assert_equal(Rational(0, 1),
121                  Rational(2, 1) - Rational(2, 1))
122     assert_equal(Rational(4, 1),
123                  Rational(2, 1) * Rational(2, 1))
124     assert_equal(Rational(1, 1),
125                  Rational(2, 1) / Rational(2, 1))
126     assert_equal(Rational(5, 1),
127                  Rational(2, 1) + Rational(3, 1))
128     assert_equal(Rational(-1, 1),
129                  Rational(2, 1) - Rational(3, 1))
130     assert_equal(Rational(6, 1),
131                  Rational(2, 1) * Rational(3, 1))
132     assert_equal(Rational(2, 3),
133                  Rational(2, 1) / Rational(3, 1))
134     assert_equal(Rational(1073741791, 1),
135                  Rational(2, 1) + Rational(1073741789, 1))
136     assert_equal(Rational(-1073741787, 1),
137                  Rational(2, 1) - Rational(1073741789, 1))
138     assert_equal(Rational(2147483578, 1),
139                  Rational(2, 1) * Rational(1073741789, 1))
140     assert_equal(Rational(2, 1073741789),
141                  Rational(2, 1) / Rational(1073741789, 1))
142     assert_equal(Rational(1073741829, 1),
143                  Rational(2, 1) + Rational(1073741827, 1))
144     assert_equal(Rational(-1073741825, 1),
145                  Rational(2, 1) - Rational(1073741827, 1))
146     assert_equal(Rational(2147483654, 1),
147                  Rational(2, 1) * Rational(1073741827, 1))
148     assert_equal(Rational(2, 1073741827),
149                  Rational(2, 1) / Rational(1073741827, 1))
150     assert_equal(Rational(8, 3),
151                  Rational(2, 1) + Rational(2, 3))
152     assert_equal(Rational(4, 3),
153                  Rational(2, 1) - Rational(2, 3))
154     assert_equal(Rational(4, 3),
155                  Rational(2, 1) * Rational(2, 3))
156     assert_equal(Rational(3, 1),
157                  Rational(2, 1) / Rational(2, 3))
158     assert_equal(Rational(7, 2),
159                  Rational(2, 1) + Rational(3, 2))
160     assert_equal(Rational(1, 2),
161                  Rational(2, 1) - Rational(3, 2))
162     assert_equal(Rational(3, 1),
163                  Rational(2, 1) * Rational(3, 2))
164     assert_equal(Rational(4, 3),
165                  Rational(2, 1) / Rational(3, 2))
166     assert_equal(Rational(2147483581, 1073741789),
167                  Rational(2, 1) + Rational(3, 1073741789))
168     assert_equal(Rational(2147483575, 1073741789),
169                  Rational(2, 1) - Rational(3, 1073741789))
170     assert_equal(Rational(6, 1073741789),
171                  Rational(2, 1) * Rational(3, 1073741789))
172     assert_equal(Rational(2147483578, 3),
173                  Rational(2, 1) / Rational(3, 1073741789))
174     assert_equal(Rational(1073741795, 3),
175                  Rational(2, 1) + Rational(1073741789, 3))
176     assert_equal(Rational(-1073741783, 3),
177                  Rational(2, 1) - Rational(1073741789, 3))
178     assert_equal(Rational(2147483578, 3),
179                  Rational(2, 1) * Rational(1073741789, 3))
180     assert_equal(Rational(6, 1073741789),
181                  Rational(2, 1) / Rational(1073741789, 3))
182     assert_equal(Rational(2147483657, 1073741827),
183                  Rational(2, 1) + Rational(3, 1073741827))
184     assert_equal(Rational(2147483651, 1073741827),
185                  Rational(2, 1) - Rational(3, 1073741827))
186     assert_equal(Rational(6, 1073741827),
187                  Rational(2, 1) * Rational(3, 1073741827))
188     assert_equal(Rational(2147483654, 3),
189                  Rational(2, 1) / Rational(3, 1073741827))
190     assert_equal(Rational(1073741833, 3),
191                  Rational(2, 1) + Rational(1073741827, 3))
192     assert_equal(Rational(-1073741821, 3),
193                  Rational(2, 1) - Rational(1073741827, 3))
194     assert_equal(Rational(2147483654, 3),
195                  Rational(2, 1) * Rational(1073741827, 3))
196     assert_equal(Rational(6, 1073741827),
197                  Rational(2, 1) / Rational(1073741827, 3))
198     assert_equal(Rational(3221225443, 1073741827),
199                  Rational(2, 1) + Rational(1073741789, 1073741827))
200     assert_equal(Rational(1073741865, 1073741827),
201                  Rational(2, 1) - Rational(1073741789, 1073741827))
202     assert_equal(Rational(2147483578, 1073741827),
203                  Rational(2, 1) * Rational(1073741789, 1073741827))
204     assert_equal(Rational(2147483654, 1073741789),
205                  Rational(2, 1) / Rational(1073741789, 1073741827))
206     assert_equal(Rational(3221225405, 1073741789),
207                  Rational(2, 1) + Rational(1073741827, 1073741789))
208     assert_equal(Rational(1073741751, 1073741789),
209                  Rational(2, 1) - Rational(1073741827, 1073741789))
210     assert_equal(Rational(2147483654, 1073741789),
211                  Rational(2, 1) * Rational(1073741827, 1073741789))
212     assert_equal(Rational(2147483578, 1073741827),
213                  Rational(2, 1) / Rational(1073741827, 1073741789))
214     assert_equal(Rational(4, 1),
215                  Rational(3, 1) + Rational(1, 1))
216     assert_equal(Rational(2, 1),
217                  Rational(3, 1) - Rational(1, 1))
218     assert_equal(Rational(3, 1),
219                  Rational(3, 1) * Rational(1, 1))
220     assert_equal(Rational(3, 1),
221                  Rational(3, 1) / Rational(1, 1))
222     assert_equal(Rational(5, 1),
223                  Rational(3, 1) + Rational(2, 1))
224     assert_equal(Rational(1, 1),
225                  Rational(3, 1) - Rational(2, 1))
226     assert_equal(Rational(6, 1),
227                  Rational(3, 1) * Rational(2, 1))
228     assert_equal(Rational(3, 2),
229                  Rational(3, 1) / Rational(2, 1))
230     assert_equal(Rational(6, 1),
231                  Rational(3, 1) + Rational(3, 1))
232     assert_equal(Rational(0, 1),
233                  Rational(3, 1) - Rational(3, 1))
234     assert_equal(Rational(9, 1),
235                  Rational(3, 1) * Rational(3, 1))
236     assert_equal(Rational(1, 1),
237                  Rational(3, 1) / Rational(3, 1))
238     assert_equal(Rational(1073741792, 1),
239                  Rational(3, 1) + Rational(1073741789, 1))
240     assert_equal(Rational(-1073741786, 1),
241                  Rational(3, 1) - Rational(1073741789, 1))
242     assert_equal(Rational(3221225367, 1),
243                  Rational(3, 1) * Rational(1073741789, 1))
244     assert_equal(Rational(3, 1073741789),
245                  Rational(3, 1) / Rational(1073741789, 1))
246     assert_equal(Rational(1073741830, 1),
247                  Rational(3, 1) + Rational(1073741827, 1))
248     assert_equal(Rational(-1073741824, 1),
249                  Rational(3, 1) - Rational(1073741827, 1))
250     assert_equal(Rational(3221225481, 1),
251                  Rational(3, 1) * Rational(1073741827, 1))
252     assert_equal(Rational(3, 1073741827),
253                  Rational(3, 1) / Rational(1073741827, 1))
254     assert_equal(Rational(11, 3),
255                  Rational(3, 1) + Rational(2, 3))
256     assert_equal(Rational(7, 3),
257                  Rational(3, 1) - Rational(2, 3))
258     assert_equal(Rational(2, 1),
259                  Rational(3, 1) * Rational(2, 3))
260     assert_equal(Rational(9, 2),
261                  Rational(3, 1) / Rational(2, 3))
262     assert_equal(Rational(9, 2),
263                  Rational(3, 1) + Rational(3, 2))
264     assert_equal(Rational(3, 2),
265                  Rational(3, 1) - Rational(3, 2))
266     assert_equal(Rational(9, 2),
267                  Rational(3, 1) * Rational(3, 2))
268     assert_equal(Rational(2, 1),
269                  Rational(3, 1) / Rational(3, 2))
270     assert_equal(Rational(3221225370, 1073741789),
271                  Rational(3, 1) + Rational(3, 1073741789))
272     assert_equal(Rational(3221225364, 1073741789),
273                  Rational(3, 1) - Rational(3, 1073741789))
274     assert_equal(Rational(9, 1073741789),
275                  Rational(3, 1) * Rational(3, 1073741789))
276     assert_equal(Rational(1073741789, 1),
277                  Rational(3, 1) / Rational(3, 1073741789))
278     assert_equal(Rational(1073741798, 3),
279                  Rational(3, 1) + Rational(1073741789, 3))
280     assert_equal(Rational(-1073741780, 3),
281                  Rational(3, 1) - Rational(1073741789, 3))
282     assert_equal(Rational(1073741789, 1),
283                  Rational(3, 1) * Rational(1073741789, 3))
284     assert_equal(Rational(9, 1073741789),
285                  Rational(3, 1) / Rational(1073741789, 3))
286     assert_equal(Rational(3221225484, 1073741827),
287                  Rational(3, 1) + Rational(3, 1073741827))
288     assert_equal(Rational(3221225478, 1073741827),
289                  Rational(3, 1) - Rational(3, 1073741827))
290     assert_equal(Rational(9, 1073741827),
291                  Rational(3, 1) * Rational(3, 1073741827))
292     assert_equal(Rational(1073741827, 1),
293                  Rational(3, 1) / Rational(3, 1073741827))
294     assert_equal(Rational(1073741836, 3),
295                  Rational(3, 1) + Rational(1073741827, 3))
296     assert_equal(Rational(-1073741818, 3),
297                  Rational(3, 1) - Rational(1073741827, 3))
298     assert_equal(Rational(1073741827, 1),
299                  Rational(3, 1) * Rational(1073741827, 3))
300     assert_equal(Rational(9, 1073741827),
301                  Rational(3, 1) / Rational(1073741827, 3))
302     assert_equal(Rational(4294967270, 1073741827),
303                  Rational(3, 1) + Rational(1073741789, 1073741827))
304     assert_equal(Rational(2147483692, 1073741827),
305                  Rational(3, 1) - Rational(1073741789, 1073741827))
306     assert_equal(Rational(3221225367, 1073741827),
307                  Rational(3, 1) * Rational(1073741789, 1073741827))
308     assert_equal(Rational(3221225481, 1073741789),
309                  Rational(3, 1) / Rational(1073741789, 1073741827))
310     assert_equal(Rational(4294967194, 1073741789),
311                  Rational(3, 1) + Rational(1073741827, 1073741789))
312     assert_equal(Rational(2147483540, 1073741789),
313                  Rational(3, 1) - Rational(1073741827, 1073741789))
314     assert_equal(Rational(3221225481, 1073741789),
315                  Rational(3, 1) * Rational(1073741827, 1073741789))
316     assert_equal(Rational(3221225367, 1073741827),
317                  Rational(3, 1) / Rational(1073741827, 1073741789))
318     assert_equal(Rational(1073741790, 1),
319                  Rational(1073741789, 1) + Rational(1, 1))
320     assert_equal(Rational(1073741788, 1),
321                  Rational(1073741789, 1) - Rational(1, 1))
322     assert_equal(Rational(1073741789, 1),
323                  Rational(1073741789, 1) * Rational(1, 1))
324     assert_equal(Rational(1073741789, 1),
325                  Rational(1073741789, 1) / Rational(1, 1))
326     assert_equal(Rational(1073741791, 1),
327                  Rational(1073741789, 1) + Rational(2, 1))
328     assert_equal(Rational(1073741787, 1),
329                  Rational(1073741789, 1) - Rational(2, 1))
330     assert_equal(Rational(2147483578, 1),
331                  Rational(1073741789, 1) * Rational(2, 1))
332     assert_equal(Rational(1073741789, 2),
333                  Rational(1073741789, 1) / Rational(2, 1))
334     assert_equal(Rational(1073741792, 1),
335                  Rational(1073741789, 1) + Rational(3, 1))
336     assert_equal(Rational(1073741786, 1),
337                  Rational(1073741789, 1) - Rational(3, 1))
338     assert_equal(Rational(3221225367, 1),
339                  Rational(1073741789, 1) * Rational(3, 1))
340     assert_equal(Rational(1073741789, 3),
341                  Rational(1073741789, 1) / Rational(3, 1))
342     assert_equal(Rational(2147483578, 1),
343                  Rational(1073741789, 1) + Rational(1073741789, 1))
344     assert_equal(Rational(0, 1),
345                  Rational(1073741789, 1) - Rational(1073741789, 1))
346     assert_equal(Rational(1152921429444920521, 1),
347                  Rational(1073741789, 1) * Rational(1073741789, 1))
348     assert_equal(Rational(1, 1),
349                  Rational(1073741789, 1) / Rational(1073741789, 1))
350     assert_equal(Rational(2147483616, 1),
351                  Rational(1073741789, 1) + Rational(1073741827, 1))
352     assert_equal(Rational(-38, 1),
353                  Rational(1073741789, 1) - Rational(1073741827, 1))
354     assert_equal(Rational(1152921470247108503, 1),
355                  Rational(1073741789, 1) * Rational(1073741827, 1))
356     assert_equal(Rational(1073741789, 1073741827),
357                  Rational(1073741789, 1) / Rational(1073741827, 1))
358     assert_equal(Rational(3221225369, 3),
359                  Rational(1073741789, 1) + Rational(2, 3))
360     assert_equal(Rational(3221225365, 3),
361                  Rational(1073741789, 1) - Rational(2, 3))
362     assert_equal(Rational(2147483578, 3),
363                  Rational(1073741789, 1) * Rational(2, 3))
364     assert_equal(Rational(3221225367, 2),
365                  Rational(1073741789, 1) / Rational(2, 3))
366     assert_equal(Rational(2147483581, 2),
367                  Rational(1073741789, 1) + Rational(3, 2))
368     assert_equal(Rational(2147483575, 2),
369                  Rational(1073741789, 1) - Rational(3, 2))
370     assert_equal(Rational(3221225367, 2),
371                  Rational(1073741789, 1) * Rational(3, 2))
372     assert_equal(Rational(2147483578, 3),
373                  Rational(1073741789, 1) / Rational(3, 2))
374     assert_equal(Rational(1152921429444920524, 1073741789),
375                  Rational(1073741789, 1) + Rational(3, 1073741789))
376     assert_equal(Rational(1152921429444920518, 1073741789),
377                  Rational(1073741789, 1) - Rational(3, 1073741789))
378     assert_equal(Rational(3, 1),
379                  Rational(1073741789, 1) * Rational(3, 1073741789))
380     assert_equal(Rational(1152921429444920521, 3),
381                  Rational(1073741789, 1) / Rational(3, 1073741789))
382     assert_equal(Rational(4294967156, 3),
383                  Rational(1073741789, 1) + Rational(1073741789, 3))
384     assert_equal(Rational(2147483578, 3),
385                  Rational(1073741789, 1) - Rational(1073741789, 3))
386     assert_equal(Rational(1152921429444920521, 3),
387                  Rational(1073741789, 1) * Rational(1073741789, 3))
388     assert_equal(Rational(3, 1),
389                  Rational(1073741789, 1) / Rational(1073741789, 3))
390     assert_equal(Rational(1152921470247108506, 1073741827),
391                  Rational(1073741789, 1) + Rational(3, 1073741827))
392     assert_equal(Rational(1152921470247108500, 1073741827),
393                  Rational(1073741789, 1) - Rational(3, 1073741827))
394     assert_equal(Rational(3221225367, 1073741827),
395                  Rational(1073741789, 1) * Rational(3, 1073741827))
396     assert_equal(Rational(1152921470247108503, 3),
397                  Rational(1073741789, 1) / Rational(3, 1073741827))
398     assert_equal(Rational(4294967194, 3),
399                  Rational(1073741789, 1) + Rational(1073741827, 3))
400     assert_equal(Rational(2147483540, 3),
401                  Rational(1073741789, 1) - Rational(1073741827, 3))
402     assert_equal(Rational(1152921470247108503, 3),
403                  Rational(1073741789, 1) * Rational(1073741827, 3))
404     assert_equal(Rational(3221225367, 1073741827),
405                  Rational(1073741789, 1) / Rational(1073741827, 3))
406     assert_equal(Rational(1152921471320850292, 1073741827),
407                  Rational(1073741789, 1) + Rational(1073741789, 1073741827))
408     assert_equal(Rational(1152921469173366714, 1073741827),
409                  Rational(1073741789, 1) - Rational(1073741789, 1073741827))
410     assert_equal(Rational(1152921429444920521, 1073741827),
411                  Rational(1073741789, 1) * Rational(1073741789, 1073741827))
412     assert_equal(Rational(1073741827, 1),
413                  Rational(1073741789, 1) / Rational(1073741789, 1073741827))
414     assert_equal(Rational(1152921430518662348, 1073741789),
415                  Rational(1073741789, 1) + Rational(1073741827, 1073741789))
416     assert_equal(Rational(1152921428371178694, 1073741789),
417                  Rational(1073741789, 1) - Rational(1073741827, 1073741789))
418     assert_equal(Rational(1073741827, 1),
419                  Rational(1073741789, 1) * Rational(1073741827, 1073741789))
420     assert_equal(Rational(1152921429444920521, 1073741827),
421                  Rational(1073741789, 1) / Rational(1073741827, 1073741789))
422     assert_equal(Rational(1073741828, 1),
423                  Rational(1073741827, 1) + Rational(1, 1))
424     assert_equal(Rational(1073741826, 1),
425                  Rational(1073741827, 1) - Rational(1, 1))
426     assert_equal(Rational(1073741827, 1),
427                  Rational(1073741827, 1) * Rational(1, 1))
428     assert_equal(Rational(1073741827, 1),
429                  Rational(1073741827, 1) / Rational(1, 1))
430     assert_equal(Rational(1073741829, 1),
431                  Rational(1073741827, 1) + Rational(2, 1))
432     assert_equal(Rational(1073741825, 1),
433                  Rational(1073741827, 1) - Rational(2, 1))
434     assert_equal(Rational(2147483654, 1),
435                  Rational(1073741827, 1) * Rational(2, 1))
436     assert_equal(Rational(1073741827, 2),
437                  Rational(1073741827, 1) / Rational(2, 1))
438     assert_equal(Rational(1073741830, 1),
439                  Rational(1073741827, 1) + Rational(3, 1))
440     assert_equal(Rational(1073741824, 1),
441                  Rational(1073741827, 1) - Rational(3, 1))
442     assert_equal(Rational(3221225481, 1),
443                  Rational(1073741827, 1) * Rational(3, 1))
444     assert_equal(Rational(1073741827, 3),
445                  Rational(1073741827, 1) / Rational(3, 1))
446     assert_equal(Rational(2147483616, 1),
447                  Rational(1073741827, 1) + Rational(1073741789, 1))
448     assert_equal(Rational(38, 1),
449                  Rational(1073741827, 1) - Rational(1073741789, 1))
450     assert_equal(Rational(1152921470247108503, 1),
451                  Rational(1073741827, 1) * Rational(1073741789, 1))
452     assert_equal(Rational(1073741827, 1073741789),
453                  Rational(1073741827, 1) / Rational(1073741789, 1))
454     assert_equal(Rational(2147483654, 1),
455                  Rational(1073741827, 1) + Rational(1073741827, 1))
456     assert_equal(Rational(0, 1),
457                  Rational(1073741827, 1) - Rational(1073741827, 1))
458     assert_equal(Rational(1152921511049297929, 1),
459                  Rational(1073741827, 1) * Rational(1073741827, 1))
460     assert_equal(Rational(1, 1),
461                  Rational(1073741827, 1) / Rational(1073741827, 1))
462     assert_equal(Rational(3221225483, 3),
463                  Rational(1073741827, 1) + Rational(2, 3))
464     assert_equal(Rational(3221225479, 3),
465                  Rational(1073741827, 1) - Rational(2, 3))
466     assert_equal(Rational(2147483654, 3),
467                  Rational(1073741827, 1) * Rational(2, 3))
468     assert_equal(Rational(3221225481, 2),
469                  Rational(1073741827, 1) / Rational(2, 3))
470     assert_equal(Rational(2147483657, 2),
471                  Rational(1073741827, 1) + Rational(3, 2))
472     assert_equal(Rational(2147483651, 2),
473                  Rational(1073741827, 1) - Rational(3, 2))
474     assert_equal(Rational(3221225481, 2),
475                  Rational(1073741827, 1) * Rational(3, 2))
476     assert_equal(Rational(2147483654, 3),
477                  Rational(1073741827, 1) / Rational(3, 2))
478     assert_equal(Rational(1152921470247108506, 1073741789),
479                  Rational(1073741827, 1) + Rational(3, 1073741789))
480     assert_equal(Rational(1152921470247108500, 1073741789),
481                  Rational(1073741827, 1) - Rational(3, 1073741789))
482     assert_equal(Rational(3221225481, 1073741789),
483                  Rational(1073741827, 1) * Rational(3, 1073741789))
484     assert_equal(Rational(1152921470247108503, 3),
485                  Rational(1073741827, 1) / Rational(3, 1073741789))
486     assert_equal(Rational(4294967270, 3),
487                  Rational(1073741827, 1) + Rational(1073741789, 3))
488     assert_equal(Rational(2147483692, 3),
489                  Rational(1073741827, 1) - Rational(1073741789, 3))
490     assert_equal(Rational(1152921470247108503, 3),
491                  Rational(1073741827, 1) * Rational(1073741789, 3))
492     assert_equal(Rational(3221225481, 1073741789),
493                  Rational(1073741827, 1) / Rational(1073741789, 3))
494     assert_equal(Rational(1152921511049297932, 1073741827),
495                  Rational(1073741827, 1) + Rational(3, 1073741827))
496     assert_equal(Rational(1152921511049297926, 1073741827),
497                  Rational(1073741827, 1) - Rational(3, 1073741827))
498     assert_equal(Rational(3, 1),
499                  Rational(1073741827, 1) * Rational(3, 1073741827))
500     assert_equal(Rational(1152921511049297929, 3),
501                  Rational(1073741827, 1) / Rational(3, 1073741827))
502     assert_equal(Rational(4294967308, 3),
503                  Rational(1073741827, 1) + Rational(1073741827, 3))
504     assert_equal(Rational(2147483654, 3),
505                  Rational(1073741827, 1) - Rational(1073741827, 3))
506     assert_equal(Rational(1152921511049297929, 3),
507                  Rational(1073741827, 1) * Rational(1073741827, 3))
508     assert_equal(Rational(3, 1),
509                  Rational(1073741827, 1) / Rational(1073741827, 3))
510     assert_equal(Rational(1152921512123039718, 1073741827),
511                  Rational(1073741827, 1) + Rational(1073741789, 1073741827))
512     assert_equal(Rational(1152921509975556140, 1073741827),
513                  Rational(1073741827, 1) - Rational(1073741789, 1073741827))
514     assert_equal(Rational(1073741789, 1),
515                  Rational(1073741827, 1) * Rational(1073741789, 1073741827))
516     assert_equal(Rational(1152921511049297929, 1073741789),
517                  Rational(1073741827, 1) / Rational(1073741789, 1073741827))
518     assert_equal(Rational(1152921471320850330, 1073741789),
519                  Rational(1073741827, 1) + Rational(1073741827, 1073741789))
520     assert_equal(Rational(1152921469173366676, 1073741789),
521                  Rational(1073741827, 1) - Rational(1073741827, 1073741789))
522     assert_equal(Rational(1152921511049297929, 1073741789),
523                  Rational(1073741827, 1) * Rational(1073741827, 1073741789))
524     assert_equal(Rational(1073741789, 1),
525                  Rational(1073741827, 1) / Rational(1073741827, 1073741789))
526     assert_equal(Rational(5, 3),
527                  Rational(2, 3) + Rational(1, 1))
528     assert_equal(Rational(-1, 3),
529                  Rational(2, 3) - Rational(1, 1))
530     assert_equal(Rational(2, 3),
531                  Rational(2, 3) * Rational(1, 1))
532     assert_equal(Rational(2, 3),
533                  Rational(2, 3) / Rational(1, 1))
534     assert_equal(Rational(8, 3),
535                  Rational(2, 3) + Rational(2, 1))
536     assert_equal(Rational(-4, 3),
537                  Rational(2, 3) - Rational(2, 1))
538     assert_equal(Rational(4, 3),
539                  Rational(2, 3) * Rational(2, 1))
540     assert_equal(Rational(1, 3),
541                  Rational(2, 3) / Rational(2, 1))
542     assert_equal(Rational(11, 3),
543                  Rational(2, 3) + Rational(3, 1))
544     assert_equal(Rational(-7, 3),
545                  Rational(2, 3) - Rational(3, 1))
546     assert_equal(Rational(2, 1),
547                  Rational(2, 3) * Rational(3, 1))
548     assert_equal(Rational(2, 9),
549                  Rational(2, 3) / Rational(3, 1))
550     assert_equal(Rational(3221225369, 3),
551                  Rational(2, 3) + Rational(1073741789, 1))
552     assert_equal(Rational(-3221225365, 3),
553                  Rational(2, 3) - Rational(1073741789, 1))
554     assert_equal(Rational(2147483578, 3),
555                  Rational(2, 3) * Rational(1073741789, 1))
556     assert_equal(Rational(2, 3221225367),
557                  Rational(2, 3) / Rational(1073741789, 1))
558     assert_equal(Rational(3221225483, 3),
559                  Rational(2, 3) + Rational(1073741827, 1))
560     assert_equal(Rational(-3221225479, 3),
561                  Rational(2, 3) - Rational(1073741827, 1))
562     assert_equal(Rational(2147483654, 3),
563                  Rational(2, 3) * Rational(1073741827, 1))
564     assert_equal(Rational(2, 3221225481),
565                  Rational(2, 3) / Rational(1073741827, 1))
566     assert_equal(Rational(4, 3),
567                  Rational(2, 3) + Rational(2, 3))
568     assert_equal(Rational(0, 1),
569                  Rational(2, 3) - Rational(2, 3))
570     assert_equal(Rational(4, 9),
571                  Rational(2, 3) * Rational(2, 3))
572     assert_equal(Rational(1, 1),
573                  Rational(2, 3) / Rational(2, 3))
574     assert_equal(Rational(13, 6),
575                  Rational(2, 3) + Rational(3, 2))
576     assert_equal(Rational(-5, 6),
577                  Rational(2, 3) - Rational(3, 2))
578     assert_equal(Rational(1, 1),
579                  Rational(2, 3) * Rational(3, 2))
580     assert_equal(Rational(4, 9),
581                  Rational(2, 3) / Rational(3, 2))
582     assert_equal(Rational(2147483587, 3221225367),
583                  Rational(2, 3) + Rational(3, 1073741789))
584     assert_equal(Rational(2147483569, 3221225367),
585                  Rational(2, 3) - Rational(3, 1073741789))
586     assert_equal(Rational(2, 1073741789),
587                  Rational(2, 3) * Rational(3, 1073741789))
588     assert_equal(Rational(2147483578, 9),
589                  Rational(2, 3) / Rational(3, 1073741789))
590     assert_equal(Rational(1073741791, 3),
591                  Rational(2, 3) + Rational(1073741789, 3))
592     assert_equal(Rational(-357913929, 1),
593                  Rational(2, 3) - Rational(1073741789, 3))
594     assert_equal(Rational(2147483578, 9),
595                  Rational(2, 3) * Rational(1073741789, 3))
596     assert_equal(Rational(2, 1073741789),
597                  Rational(2, 3) / Rational(1073741789, 3))
598     assert_equal(Rational(2147483663, 3221225481),
599                  Rational(2, 3) + Rational(3, 1073741827))
600     assert_equal(Rational(2147483645, 3221225481),
601                  Rational(2, 3) - Rational(3, 1073741827))
602     assert_equal(Rational(2, 1073741827),
603                  Rational(2, 3) * Rational(3, 1073741827))
604     assert_equal(Rational(2147483654, 9),
605                  Rational(2, 3) / Rational(3, 1073741827))
606     assert_equal(Rational(357913943, 1),
607                  Rational(2, 3) + Rational(1073741827, 3))
608     assert_equal(Rational(-1073741825, 3),
609                  Rational(2, 3) - Rational(1073741827, 3))
610     assert_equal(Rational(2147483654, 9),
611                  Rational(2, 3) * Rational(1073741827, 3))
612     assert_equal(Rational(2, 1073741827),
613                  Rational(2, 3) / Rational(1073741827, 3))
614     assert_equal(Rational(5368709021, 3221225481),
615                  Rational(2, 3) + Rational(1073741789, 1073741827))
616     assert_equal(Rational(-1073741713, 3221225481),
617                  Rational(2, 3) - Rational(1073741789, 1073741827))
618     assert_equal(Rational(2147483578, 3221225481),
619                  Rational(2, 3) * Rational(1073741789, 1073741827))
620     assert_equal(Rational(2147483654, 3221225367),
621                  Rational(2, 3) / Rational(1073741789, 1073741827))
622     assert_equal(Rational(5368709059, 3221225367),
623                  Rational(2, 3) + Rational(1073741827, 1073741789))
624     assert_equal(Rational(-1073741903, 3221225367),
625                  Rational(2, 3) - Rational(1073741827, 1073741789))
626     assert_equal(Rational(2147483654, 3221225367),
627                  Rational(2, 3) * Rational(1073741827, 1073741789))
628     assert_equal(Rational(2147483578, 3221225481),
629                  Rational(2, 3) / Rational(1073741827, 1073741789))
630     assert_equal(Rational(5, 2),
631                  Rational(3, 2) + Rational(1, 1))
632     assert_equal(Rational(1, 2),
633                  Rational(3, 2) - Rational(1, 1))
634     assert_equal(Rational(3, 2),
635                  Rational(3, 2) * Rational(1, 1))
636     assert_equal(Rational(3, 2),
637                  Rational(3, 2) / Rational(1, 1))
638     assert_equal(Rational(7, 2),
639                  Rational(3, 2) + Rational(2, 1))
640     assert_equal(Rational(-1, 2),
641                  Rational(3, 2) - Rational(2, 1))
642     assert_equal(Rational(3, 1),
643                  Rational(3, 2) * Rational(2, 1))
644     assert_equal(Rational(3, 4),
645                  Rational(3, 2) / Rational(2, 1))
646     assert_equal(Rational(9, 2),
647                  Rational(3, 2) + Rational(3, 1))
648     assert_equal(Rational(-3, 2),
649                  Rational(3, 2) - Rational(3, 1))
650     assert_equal(Rational(9, 2),
651                  Rational(3, 2) * Rational(3, 1))
652     assert_equal(Rational(1, 2),
653                  Rational(3, 2) / Rational(3, 1))
654     assert_equal(Rational(2147483581, 2),
655                  Rational(3, 2) + Rational(1073741789, 1))
656     assert_equal(Rational(-2147483575, 2),
657                  Rational(3, 2) - Rational(1073741789, 1))
658     assert_equal(Rational(3221225367, 2),
659                  Rational(3, 2) * Rational(1073741789, 1))
660     assert_equal(Rational(3, 2147483578),
661                  Rational(3, 2) / Rational(1073741789, 1))
662     assert_equal(Rational(2147483657, 2),
663                  Rational(3, 2) + Rational(1073741827, 1))
664     assert_equal(Rational(-2147483651, 2),
665                  Rational(3, 2) - Rational(1073741827, 1))
666     assert_equal(Rational(3221225481, 2),
667                  Rational(3, 2) * Rational(1073741827, 1))
668     assert_equal(Rational(3, 2147483654),
669                  Rational(3, 2) / Rational(1073741827, 1))
670     assert_equal(Rational(13, 6),
671                  Rational(3, 2) + Rational(2, 3))
672     assert_equal(Rational(5, 6),
673                  Rational(3, 2) - Rational(2, 3))
674     assert_equal(Rational(1, 1),
675                  Rational(3, 2) * Rational(2, 3))
676     assert_equal(Rational(9, 4),
677                  Rational(3, 2) / Rational(2, 3))
678     assert_equal(Rational(3, 1),
679                  Rational(3, 2) + Rational(3, 2))
680     assert_equal(Rational(0, 1),
681                  Rational(3, 2) - Rational(3, 2))
682     assert_equal(Rational(9, 4),
683                  Rational(3, 2) * Rational(3, 2))
684     assert_equal(Rational(1, 1),
685                  Rational(3, 2) / Rational(3, 2))
686     assert_equal(Rational(3221225373, 2147483578),
687                  Rational(3, 2) + Rational(3, 1073741789))
688     assert_equal(Rational(3221225361, 2147483578),
689                  Rational(3, 2) - Rational(3, 1073741789))
690     assert_equal(Rational(9, 2147483578),
691                  Rational(3, 2) * Rational(3, 1073741789))
692     assert_equal(Rational(1073741789, 2),
693                  Rational(3, 2) / Rational(3, 1073741789))
694     assert_equal(Rational(2147483587, 6),
695                  Rational(3, 2) + Rational(1073741789, 3))
696     assert_equal(Rational(-2147483569, 6),
697                  Rational(3, 2) - Rational(1073741789, 3))
698     assert_equal(Rational(1073741789, 2),
699                  Rational(3, 2) * Rational(1073741789, 3))
700     assert_equal(Rational(9, 2147483578),
701                  Rational(3, 2) / Rational(1073741789, 3))
702     assert_equal(Rational(3221225487, 2147483654),
703                  Rational(3, 2) + Rational(3, 1073741827))
704     assert_equal(Rational(3221225475, 2147483654),
705                  Rational(3, 2) - Rational(3, 1073741827))
706     assert_equal(Rational(9, 2147483654),
707                  Rational(3, 2) * Rational(3, 1073741827))
708     assert_equal(Rational(1073741827, 2),
709                  Rational(3, 2) / Rational(3, 1073741827))
710     assert_equal(Rational(2147483663, 6),
711                  Rational(3, 2) + Rational(1073741827, 3))
712     assert_equal(Rational(-2147483645, 6),
713                  Rational(3, 2) - Rational(1073741827, 3))
714     assert_equal(Rational(1073741827, 2),
715                  Rational(3, 2) * Rational(1073741827, 3))
716     assert_equal(Rational(9, 2147483654),
717                  Rational(3, 2) / Rational(1073741827, 3))
718     assert_equal(Rational(5368709059, 2147483654),
719                  Rational(3, 2) + Rational(1073741789, 1073741827))
720     assert_equal(Rational(1073741903, 2147483654),
721                  Rational(3, 2) - Rational(1073741789, 1073741827))
722     assert_equal(Rational(3221225367, 2147483654),
723                  Rational(3, 2) * Rational(1073741789, 1073741827))
724     assert_equal(Rational(3221225481, 2147483578),
725                  Rational(3, 2) / Rational(1073741789, 1073741827))
726     assert_equal(Rational(5368709021, 2147483578),
727                  Rational(3, 2) + Rational(1073741827, 1073741789))
728     assert_equal(Rational(1073741713, 2147483578),
729                  Rational(3, 2) - Rational(1073741827, 1073741789))
730     assert_equal(Rational(3221225481, 2147483578),
731                  Rational(3, 2) * Rational(1073741827, 1073741789))
732     assert_equal(Rational(3221225367, 2147483654),
733                  Rational(3, 2) / Rational(1073741827, 1073741789))
734     assert_equal(Rational(1073741792, 1073741789),
735                  Rational(3, 1073741789) + Rational(1, 1))
736     assert_equal(Rational(-1073741786, 1073741789),
737                  Rational(3, 1073741789) - Rational(1, 1))
738     assert_equal(Rational(3, 1073741789),
739                  Rational(3, 1073741789) * Rational(1, 1))
740     assert_equal(Rational(3, 1073741789),
741                  Rational(3, 1073741789) / Rational(1, 1))
742     assert_equal(Rational(2147483581, 1073741789),
743                  Rational(3, 1073741789) + Rational(2, 1))
744     assert_equal(Rational(-2147483575, 1073741789),
745                  Rational(3, 1073741789) - Rational(2, 1))
746     assert_equal(Rational(6, 1073741789),
747                  Rational(3, 1073741789) * Rational(2, 1))
748     assert_equal(Rational(3, 2147483578),
749                  Rational(3, 1073741789) / Rational(2, 1))
750     assert_equal(Rational(3221225370, 1073741789),
751                  Rational(3, 1073741789) + Rational(3, 1))
752     assert_equal(Rational(-3221225364, 1073741789),
753                  Rational(3, 1073741789) - Rational(3, 1))
754     assert_equal(Rational(9, 1073741789),
755                  Rational(3, 1073741789) * Rational(3, 1))
756     assert_equal(Rational(1, 1073741789),
757                  Rational(3, 1073741789) / Rational(3, 1))
758     assert_equal(Rational(1152921429444920524, 1073741789),
759                  Rational(3, 1073741789) + Rational(1073741789, 1))
760     assert_equal(Rational(-1152921429444920518, 1073741789),
761                  Rational(3, 1073741789) - Rational(1073741789, 1))
762     assert_equal(Rational(3, 1),
763                  Rational(3, 1073741789) * Rational(1073741789, 1))
764     assert_equal(Rational(3, 1152921429444920521),
765                  Rational(3, 1073741789) / Rational(1073741789, 1))
766     assert_equal(Rational(1152921470247108506, 1073741789),
767                  Rational(3, 1073741789) + Rational(1073741827, 1))
768     assert_equal(Rational(-1152921470247108500, 1073741789),
769                  Rational(3, 1073741789) - Rational(1073741827, 1))
770     assert_equal(Rational(3221225481, 1073741789),
771                  Rational(3, 1073741789) * Rational(1073741827, 1))
772     assert_equal(Rational(3, 1152921470247108503),
773                  Rational(3, 1073741789) / Rational(1073741827, 1))
774     assert_equal(Rational(2147483587, 3221225367),
775                  Rational(3, 1073741789) + Rational(2, 3))
776     assert_equal(Rational(-2147483569, 3221225367),
777                  Rational(3, 1073741789) - Rational(2, 3))
778     assert_equal(Rational(2, 1073741789),
779                  Rational(3, 1073741789) * Rational(2, 3))
780     assert_equal(Rational(9, 2147483578),
781                  Rational(3, 1073741789) / Rational(2, 3))
782     assert_equal(Rational(3221225373, 2147483578),
783                  Rational(3, 1073741789) + Rational(3, 2))
784     assert_equal(Rational(-3221225361, 2147483578),
785                  Rational(3, 1073741789) - Rational(3, 2))
786     assert_equal(Rational(9, 2147483578),
787                  Rational(3, 1073741789) * Rational(3, 2))
788     assert_equal(Rational(2, 1073741789),
789                  Rational(3, 1073741789) / Rational(3, 2))
790     assert_equal(Rational(6, 1073741789),
791                  Rational(3, 1073741789) + Rational(3, 1073741789))
792     assert_equal(Rational(0, 1),
793                  Rational(3, 1073741789) - Rational(3, 1073741789))
794     assert_equal(Rational(9, 1152921429444920521),
795                  Rational(3, 1073741789) * Rational(3, 1073741789))
796     assert_equal(Rational(1, 1),
797                  Rational(3, 1073741789) / Rational(3, 1073741789))
798     assert_equal(Rational(1152921429444920530, 3221225367),
799                  Rational(3, 1073741789) + Rational(1073741789, 3))
800     assert_equal(Rational(-1152921429444920512, 3221225367),
801                  Rational(3, 1073741789) - Rational(1073741789, 3))
802     assert_equal(Rational(1, 1),
803                  Rational(3, 1073741789) * Rational(1073741789, 3))
804     assert_equal(Rational(9, 1152921429444920521),
805                  Rational(3, 1073741789) / Rational(1073741789, 3))
806     assert_equal(Rational(6442450848, 1152921470247108503),
807                  Rational(3, 1073741789) + Rational(3, 1073741827))
808     assert_equal(Rational(114, 1152921470247108503),
809                  Rational(3, 1073741789) - Rational(3, 1073741827))
810     assert_equal(Rational(9, 1152921470247108503),
811                  Rational(3, 1073741789) * Rational(3, 1073741827))
812     assert_equal(Rational(1073741827, 1073741789),
813                  Rational(3, 1073741789) / Rational(3, 1073741827))
814     assert_equal(Rational(1152921470247108512, 3221225367),
815                  Rational(3, 1073741789) + Rational(1073741827, 3))
816     assert_equal(Rational(-1152921470247108494, 3221225367),
817                  Rational(3, 1073741789) - Rational(1073741827, 3))
818     assert_equal(Rational(1073741827, 1073741789),
819                  Rational(3, 1073741789) * Rational(1073741827, 3))
820     assert_equal(Rational(9, 1152921470247108503),
821                  Rational(3, 1073741789) / Rational(1073741827, 3))
822     assert_equal(Rational(1152921432666146002, 1152921470247108503),
823                  Rational(3, 1073741789) + Rational(1073741789, 1073741827))
824     assert_equal(Rational(-1152921426223695040, 1152921470247108503),
825                  Rational(3, 1073741789) - Rational(1073741789, 1073741827))
826     assert_equal(Rational(3, 1073741827),
827                  Rational(3, 1073741789) * Rational(1073741789, 1073741827))
828     assert_equal(Rational(3221225481, 1152921429444920521),
829                  Rational(3, 1073741789) / Rational(1073741789, 1073741827))
830     assert_equal(Rational(1073741830, 1073741789),
831                  Rational(3, 1073741789) + Rational(1073741827, 1073741789))
832     assert_equal(Rational(-1073741824, 1073741789),
833                  Rational(3, 1073741789) - Rational(1073741827, 1073741789))
834     assert_equal(Rational(3221225481, 1152921429444920521),
835                  Rational(3, 1073741789) * Rational(1073741827, 1073741789))
836     assert_equal(Rational(3, 1073741827),
837                  Rational(3, 1073741789) / Rational(1073741827, 1073741789))
838     assert_equal(Rational(1073741792, 3),
839                  Rational(1073741789, 3) + Rational(1, 1))
840     assert_equal(Rational(1073741786, 3),
841                  Rational(1073741789, 3) - Rational(1, 1))
842     assert_equal(Rational(1073741789, 3),
843                  Rational(1073741789, 3) * Rational(1, 1))
844     assert_equal(Rational(1073741789, 3),
845                  Rational(1073741789, 3) / Rational(1, 1))
846     assert_equal(Rational(1073741795, 3),
847                  Rational(1073741789, 3) + Rational(2, 1))
848     assert_equal(Rational(1073741783, 3),
849                  Rational(1073741789, 3) - Rational(2, 1))
850     assert_equal(Rational(2147483578, 3),
851                  Rational(1073741789, 3) * Rational(2, 1))
852     assert_equal(Rational(1073741789, 6),
853                  Rational(1073741789, 3) / Rational(2, 1))
854     assert_equal(Rational(1073741798, 3),
855                  Rational(1073741789, 3) + Rational(3, 1))
856     assert_equal(Rational(1073741780, 3),
857                  Rational(1073741789, 3) - Rational(3, 1))
858     assert_equal(Rational(1073741789, 1),
859                  Rational(1073741789, 3) * Rational(3, 1))
860     assert_equal(Rational(1073741789, 9),
861                  Rational(1073741789, 3) / Rational(3, 1))
862     assert_equal(Rational(4294967156, 3),
863                  Rational(1073741789, 3) + Rational(1073741789, 1))
864     assert_equal(Rational(-2147483578, 3),
865                  Rational(1073741789, 3) - Rational(1073741789, 1))
866     assert_equal(Rational(1152921429444920521, 3),
867                  Rational(1073741789, 3) * Rational(1073741789, 1))
868     assert_equal(Rational(1, 3),
869                  Rational(1073741789, 3) / Rational(1073741789, 1))
870     assert_equal(Rational(4294967270, 3),
871                  Rational(1073741789, 3) + Rational(1073741827, 1))
872     assert_equal(Rational(-2147483692, 3),
873                  Rational(1073741789, 3) - Rational(1073741827, 1))
874     assert_equal(Rational(1152921470247108503, 3),
875                  Rational(1073741789, 3) * Rational(1073741827, 1))
876     assert_equal(Rational(1073741789, 3221225481),
877                  Rational(1073741789, 3) / Rational(1073741827, 1))
878     assert_equal(Rational(1073741791, 3),
879                  Rational(1073741789, 3) + Rational(2, 3))
880     assert_equal(Rational(357913929, 1),
881                  Rational(1073741789, 3) - Rational(2, 3))
882     assert_equal(Rational(2147483578, 9),
883                  Rational(1073741789, 3) * Rational(2, 3))
884     assert_equal(Rational(1073741789, 2),
885                  Rational(1073741789, 3) / Rational(2, 3))
886     assert_equal(Rational(2147483587, 6),
887                  Rational(1073741789, 3) + Rational(3, 2))
888     assert_equal(Rational(2147483569, 6),
889                  Rational(1073741789, 3) - Rational(3, 2))
890     assert_equal(Rational(1073741789, 2),
891                  Rational(1073741789, 3) * Rational(3, 2))
892     assert_equal(Rational(2147483578, 9),
893                  Rational(1073741789, 3) / Rational(3, 2))
894     assert_equal(Rational(1152921429444920530, 3221225367),
895                  Rational(1073741789, 3) + Rational(3, 1073741789))
896     assert_equal(Rational(1152921429444920512, 3221225367),
897                  Rational(1073741789, 3) - Rational(3, 1073741789))
898     assert_equal(Rational(1, 1),
899                  Rational(1073741789, 3) * Rational(3, 1073741789))
900     assert_equal(Rational(1152921429444920521, 9),
901                  Rational(1073741789, 3) / Rational(3, 1073741789))
902     assert_equal(Rational(2147483578, 3),
903                  Rational(1073741789, 3) + Rational(1073741789, 3))
904     assert_equal(Rational(0, 1),
905                  Rational(1073741789, 3) - Rational(1073741789, 3))
906     assert_equal(Rational(1152921429444920521, 9),
907                  Rational(1073741789, 3) * Rational(1073741789, 3))
908     assert_equal(Rational(1, 1),
909                  Rational(1073741789, 3) / Rational(1073741789, 3))
910     assert_equal(Rational(1152921470247108512, 3221225481),
911                  Rational(1073741789, 3) + Rational(3, 1073741827))
912     assert_equal(Rational(1152921470247108494, 3221225481),
913                  Rational(1073741789, 3) - Rational(3, 1073741827))
914     assert_equal(Rational(1073741789, 1073741827),
915                  Rational(1073741789, 3) * Rational(3, 1073741827))
916     assert_equal(Rational(1152921470247108503, 9),
917                  Rational(1073741789, 3) / Rational(3, 1073741827))
918     assert_equal(Rational(715827872, 1),
919                  Rational(1073741789, 3) + Rational(1073741827, 3))
920     assert_equal(Rational(-38, 3),
921                  Rational(1073741789, 3) - Rational(1073741827, 3))
922     assert_equal(Rational(1152921470247108503, 9),
923                  Rational(1073741789, 3) * Rational(1073741827, 3))
924     assert_equal(Rational(1073741789, 1073741827),
925                  Rational(1073741789, 3) / Rational(1073741827, 3))
926     assert_equal(Rational(1152921473468333870, 3221225481),
927                  Rational(1073741789, 3) + Rational(1073741789, 1073741827))
928     assert_equal(Rational(1152921467025883136, 3221225481),
929                  Rational(1073741789, 3) - Rational(1073741789, 1073741827))
930     assert_equal(Rational(1152921429444920521, 3221225481),
931                  Rational(1073741789, 3) * Rational(1073741789, 1073741827))
932     assert_equal(Rational(1073741827, 3),
933                  Rational(1073741789, 3) / Rational(1073741789, 1073741827))
934     assert_equal(Rational(1152921432666146002, 3221225367),
935                  Rational(1073741789, 3) + Rational(1073741827, 1073741789))
936     assert_equal(Rational(1152921426223695040, 3221225367),
937                  Rational(1073741789, 3) - Rational(1073741827, 1073741789))
938     assert_equal(Rational(1073741827, 3),
939                  Rational(1073741789, 3) * Rational(1073741827, 1073741789))
940     assert_equal(Rational(1152921429444920521, 3221225481),
941                  Rational(1073741789, 3) / Rational(1073741827, 1073741789))
942     assert_equal(Rational(1073741830, 1073741827),
943                  Rational(3, 1073741827) + Rational(1, 1))
944     assert_equal(Rational(-1073741824, 1073741827),
945                  Rational(3, 1073741827) - Rational(1, 1))
946     assert_equal(Rational(3, 1073741827),
947                  Rational(3, 1073741827) * Rational(1, 1))
948     assert_equal(Rational(3, 1073741827),
949                  Rational(3, 1073741827) / Rational(1, 1))
950     assert_equal(Rational(2147483657, 1073741827),
951                  Rational(3, 1073741827) + Rational(2, 1))
952     assert_equal(Rational(-2147483651, 1073741827),
953                  Rational(3, 1073741827) - Rational(2, 1))
954     assert_equal(Rational(6, 1073741827),
955                  Rational(3, 1073741827) * Rational(2, 1))
956     assert_equal(Rational(3, 2147483654),
957                  Rational(3, 1073741827) / Rational(2, 1))
958     assert_equal(Rational(3221225484, 1073741827),
959                  Rational(3, 1073741827) + Rational(3, 1))
960     assert_equal(Rational(-3221225478, 1073741827),
961                  Rational(3, 1073741827) - Rational(3, 1))
962     assert_equal(Rational(9, 1073741827),
963                  Rational(3, 1073741827) * Rational(3, 1))
964     assert_equal(Rational(1, 1073741827),
965                  Rational(3, 1073741827) / Rational(3, 1))
966     assert_equal(Rational(1152921470247108506, 1073741827),
967                  Rational(3, 1073741827) + Rational(1073741789, 1))
968     assert_equal(Rational(-1152921470247108500, 1073741827),
969                  Rational(3, 1073741827) - Rational(1073741789, 1))
970     assert_equal(Rational(3221225367, 1073741827),
971                  Rational(3, 1073741827) * Rational(1073741789, 1))
972     assert_equal(Rational(3, 1152921470247108503),
973                  Rational(3, 1073741827) / Rational(1073741789, 1))
974     assert_equal(Rational(1152921511049297932, 1073741827),
975                  Rational(3, 1073741827) + Rational(1073741827, 1))
976     assert_equal(Rational(-1152921511049297926, 1073741827),
977                  Rational(3, 1073741827) - Rational(1073741827, 1))
978     assert_equal(Rational(3, 1),
979                  Rational(3, 1073741827) * Rational(1073741827, 1))
980     assert_equal(Rational(3, 1152921511049297929),
981                  Rational(3, 1073741827) / Rational(1073741827, 1))
982     assert_equal(Rational(2147483663, 3221225481),
983                  Rational(3, 1073741827) + Rational(2, 3))
984     assert_equal(Rational(-2147483645, 3221225481),
985                  Rational(3, 1073741827) - Rational(2, 3))
986     assert_equal(Rational(2, 1073741827),
987                  Rational(3, 1073741827) * Rational(2, 3))
988     assert_equal(Rational(9, 2147483654),
989                  Rational(3, 1073741827) / Rational(2, 3))
990     assert_equal(Rational(3221225487, 2147483654),
991                  Rational(3, 1073741827) + Rational(3, 2))
992     assert_equal(Rational(-3221225475, 2147483654),
993                  Rational(3, 1073741827) - Rational(3, 2))
994     assert_equal(Rational(9, 2147483654),
995                  Rational(3, 1073741827) * Rational(3, 2))
996     assert_equal(Rational(2, 1073741827),
997                  Rational(3, 1073741827) / Rational(3, 2))
998     assert_equal(Rational(6442450848, 1152921470247108503),
999                  Rational(3, 1073741827) + Rational(3, 1073741789))
1000     assert_equal(Rational(-114, 1152921470247108503),
1001                  Rational(3, 1073741827) - Rational(3, 1073741789))
1002     assert_equal(Rational(9, 1152921470247108503),
1003                  Rational(3, 1073741827) * Rational(3, 1073741789))
1004     assert_equal(Rational(1073741789, 1073741827),
1005                  Rational(3, 1073741827) / Rational(3, 1073741789))
1006     assert_equal(Rational(1152921470247108512, 3221225481),
1007                  Rational(3, 1073741827) + Rational(1073741789, 3))
1008     assert_equal(Rational(-1152921470247108494, 3221225481),
1009                  Rational(3, 1073741827) - Rational(1073741789, 3))
1010     assert_equal(Rational(1073741789, 1073741827),
1011                  Rational(3, 1073741827) * Rational(1073741789, 3))
1012     assert_equal(Rational(9, 1152921470247108503),
1013                  Rational(3, 1073741827) / Rational(1073741789, 3))
1014     assert_equal(Rational(6, 1073741827),
1015                  Rational(3, 1073741827) + Rational(3, 1073741827))
1016     assert_equal(Rational(0, 1),
1017                  Rational(3, 1073741827) - Rational(3, 1073741827))
1018     assert_equal(Rational(9, 1152921511049297929),
1019                  Rational(3, 1073741827) * Rational(3, 1073741827))
1020     assert_equal(Rational(1, 1),
1021                  Rational(3, 1073741827) / Rational(3, 1073741827))
1022     assert_equal(Rational(1152921511049297938, 3221225481),
1023                  Rational(3, 1073741827) + Rational(1073741827, 3))
1024     assert_equal(Rational(-1152921511049297920, 3221225481),
1025                  Rational(3, 1073741827) - Rational(1073741827, 3))
1026     assert_equal(Rational(1, 1),
1027                  Rational(3, 1073741827) * Rational(1073741827, 3))
1028     assert_equal(Rational(9, 1152921511049297929),
1029                  Rational(3, 1073741827) / Rational(1073741827, 3))
1030     assert_equal(Rational(1073741792, 1073741827),
1031                  Rational(3, 1073741827) + Rational(1073741789, 1073741827))
1032     assert_equal(Rational(-1073741786, 1073741827),
1033                  Rational(3, 1073741827) - Rational(1073741789, 1073741827))
1034     assert_equal(Rational(3221225367, 1152921511049297929),
1035                  Rational(3, 1073741827) * Rational(1073741789, 1073741827))
1036     assert_equal(Rational(3, 1073741789),
1037                  Rational(3, 1073741827) / Rational(1073741789, 1073741827))
1038     assert_equal(Rational(1152921514270523296, 1152921470247108503),
1039                  Rational(3, 1073741827) + Rational(1073741827, 1073741789))
1040     assert_equal(Rational(-1152921507828072562, 1152921470247108503),
1041                  Rational(3, 1073741827) - Rational(1073741827, 1073741789))
1042     assert_equal(Rational(3, 1073741789),
1043                  Rational(3, 1073741827) * Rational(1073741827, 1073741789))
1044     assert_equal(Rational(3221225367, 1152921511049297929),
1045                  Rational(3, 1073741827) / Rational(1073741827, 1073741789))
1046     assert_equal(Rational(1073741830, 3),
1047                  Rational(1073741827, 3) + Rational(1, 1))
1048     assert_equal(Rational(1073741824, 3),
1049                  Rational(1073741827, 3) - Rational(1, 1))
1050     assert_equal(Rational(1073741827, 3),
1051                  Rational(1073741827, 3) * Rational(1, 1))
1052     assert_equal(Rational(1073741827, 3),
1053                  Rational(1073741827, 3) / Rational(1, 1))
1054     assert_equal(Rational(1073741833, 3),
1055                  Rational(1073741827, 3) + Rational(2, 1))
1056     assert_equal(Rational(1073741821, 3),
1057                  Rational(1073741827, 3) - Rational(2, 1))
1058     assert_equal(Rational(2147483654, 3),
1059                  Rational(1073741827, 3) * Rational(2, 1))
1060     assert_equal(Rational(1073741827, 6),
1061                  Rational(1073741827, 3) / Rational(2, 1))
1062     assert_equal(Rational(1073741836, 3),
1063                  Rational(1073741827, 3) + Rational(3, 1))
1064     assert_equal(Rational(1073741818, 3),
1065                  Rational(1073741827, 3) - Rational(3, 1))
1066     assert_equal(Rational(1073741827, 1),
1067                  Rational(1073741827, 3) * Rational(3, 1))
1068     assert_equal(Rational(1073741827, 9),
1069                  Rational(1073741827, 3) / Rational(3, 1))
1070     assert_equal(Rational(4294967194, 3),
1071                  Rational(1073741827, 3) + Rational(1073741789, 1))
1072     assert_equal(Rational(-2147483540, 3),
1073                  Rational(1073741827, 3) - Rational(1073741789, 1))
1074     assert_equal(Rational(1152921470247108503, 3),
1075                  Rational(1073741827, 3) * Rational(1073741789, 1))
1076     assert_equal(Rational(1073741827, 3221225367),
1077                  Rational(1073741827, 3) / Rational(1073741789, 1))
1078     assert_equal(Rational(4294967308, 3),
1079                  Rational(1073741827, 3) + Rational(1073741827, 1))
1080     assert_equal(Rational(-2147483654, 3),
1081                  Rational(1073741827, 3) - Rational(1073741827, 1))
1082     assert_equal(Rational(1152921511049297929, 3),
1083                  Rational(1073741827, 3) * Rational(1073741827, 1))
1084     assert_equal(Rational(1, 3),
1085                  Rational(1073741827, 3) / Rational(1073741827, 1))
1086     assert_equal(Rational(357913943, 1),
1087                  Rational(1073741827, 3) + Rational(2, 3))
1088     assert_equal(Rational(1073741825, 3),
1089                  Rational(1073741827, 3) - Rational(2, 3))
1090     assert_equal(Rational(2147483654, 9),
1091                  Rational(1073741827, 3) * Rational(2, 3))
1092     assert_equal(Rational(1073741827, 2),
1093                  Rational(1073741827, 3) / Rational(2, 3))
1094     assert_equal(Rational(2147483663, 6),
1095                  Rational(1073741827, 3) + Rational(3, 2))
1096     assert_equal(Rational(2147483645, 6),
1097                  Rational(1073741827, 3) - Rational(3, 2))
1098     assert_equal(Rational(1073741827, 2),
1099                  Rational(1073741827, 3) * Rational(3, 2))
1100     assert_equal(Rational(2147483654, 9),
1101                  Rational(1073741827, 3) / Rational(3, 2))
1102     assert_equal(Rational(1152921470247108512, 3221225367),
1103                  Rational(1073741827, 3) + Rational(3, 1073741789))
1104     assert_equal(Rational(1152921470247108494, 3221225367),
1105                  Rational(1073741827, 3) - Rational(3, 1073741789))
1106     assert_equal(Rational(1073741827, 1073741789),
1107                  Rational(1073741827, 3) * Rational(3, 1073741789))
1108     assert_equal(Rational(1152921470247108503, 9),
1109                  Rational(1073741827, 3) / Rational(3, 1073741789))
1110     assert_equal(Rational(715827872, 1),
1111                  Rational(1073741827, 3) + Rational(1073741789, 3))
1112     assert_equal(Rational(38, 3),
1113                  Rational(1073741827, 3) - Rational(1073741789, 3))
1114     assert_equal(Rational(1152921470247108503, 9),
1115                  Rational(1073741827, 3) * Rational(1073741789, 3))
1116     assert_equal(Rational(1073741827, 1073741789),
1117                  Rational(1073741827, 3) / Rational(1073741789, 3))
1118     assert_equal(Rational(1152921511049297938, 3221225481),
1119                  Rational(1073741827, 3) + Rational(3, 1073741827))
1120     assert_equal(Rational(1152921511049297920, 3221225481),
1121                  Rational(1073741827, 3) - Rational(3, 1073741827))
1122     assert_equal(Rational(1, 1),
1123                  Rational(1073741827, 3) * Rational(3, 1073741827))
1124     assert_equal(Rational(1152921511049297929, 9),
1125                  Rational(1073741827, 3) / Rational(3, 1073741827))
1126     assert_equal(Rational(2147483654, 3),
1127                  Rational(1073741827, 3) + Rational(1073741827, 3))
1128     assert_equal(Rational(0, 1),
1129                  Rational(1073741827, 3) - Rational(1073741827, 3))
1130     assert_equal(Rational(1152921511049297929, 9),
1131                  Rational(1073741827, 3) * Rational(1073741827, 3))
1132     assert_equal(Rational(1, 1),
1133                  Rational(1073741827, 3) / Rational(1073741827, 3))
1134     assert_equal(Rational(1152921514270523296, 3221225481),
1135                  Rational(1073741827, 3) + Rational(1073741789, 1073741827))
1136     assert_equal(Rational(1152921507828072562, 3221225481),
1137                  Rational(1073741827, 3) - Rational(1073741789, 1073741827))
1138     assert_equal(Rational(1073741789, 3),
1139                  Rational(1073741827, 3) * Rational(1073741789, 1073741827))
1140     assert_equal(Rational(1152921511049297929, 3221225367),
1141                  Rational(1073741827, 3) / Rational(1073741789, 1073741827))
1142     assert_equal(Rational(1152921473468333984, 3221225367),
1143                  Rational(1073741827, 3) + Rational(1073741827, 1073741789))
1144     assert_equal(Rational(1152921467025883022, 3221225367),
1145                  Rational(1073741827, 3) - Rational(1073741827, 1073741789))
1146     assert_equal(Rational(1152921511049297929, 3221225367),
1147                  Rational(1073741827, 3) * Rational(1073741827, 1073741789))
1148     assert_equal(Rational(1073741789, 3),
1149                  Rational(1073741827, 3) / Rational(1073741827, 1073741789))
1150     assert_equal(Rational(2147483616, 1073741827),
1151                  Rational(1073741789, 1073741827) + Rational(1, 1))
1152     assert_equal(Rational(-38, 1073741827),
1153                  Rational(1073741789, 1073741827) - Rational(1, 1))
1154     assert_equal(Rational(1073741789, 1073741827),
1155                  Rational(1073741789, 1073741827) * Rational(1, 1))
1156     assert_equal(Rational(1073741789, 1073741827),
1157                  Rational(1073741789, 1073741827) / Rational(1, 1))
1158     assert_equal(Rational(3221225443, 1073741827),
1159                  Rational(1073741789, 1073741827) + Rational(2, 1))
1160     assert_equal(Rational(-1073741865, 1073741827),
1161                  Rational(1073741789, 1073741827) - Rational(2, 1))
1162     assert_equal(Rational(2147483578, 1073741827),
1163                  Rational(1073741789, 1073741827) * Rational(2, 1))
1164     assert_equal(Rational(1073741789, 2147483654),
1165                  Rational(1073741789, 1073741827) / Rational(2, 1))
1166     assert_equal(Rational(4294967270, 1073741827),
1167                  Rational(1073741789, 1073741827) + Rational(3, 1))
1168     assert_equal(Rational(-2147483692, 1073741827),
1169                  Rational(1073741789, 1073741827) - Rational(3, 1))
1170     assert_equal(Rational(3221225367, 1073741827),
1171                  Rational(1073741789, 1073741827) * Rational(3, 1))
1172     assert_equal(Rational(1073741789, 3221225481),
1173                  Rational(1073741789, 1073741827) / Rational(3, 1))
1174     assert_equal(Rational(1152921471320850292, 1073741827),
1175                  Rational(1073741789, 1073741827) + Rational(1073741789, 1))
1176     assert_equal(Rational(-1152921469173366714, 1073741827),
1177                  Rational(1073741789, 1073741827) - Rational(1073741789, 1))
1178     assert_equal(Rational(1152921429444920521, 1073741827),
1179                  Rational(1073741789, 1073741827) * Rational(1073741789, 1))
1180     assert_equal(Rational(1, 1073741827),
1181                  Rational(1073741789, 1073741827) / Rational(1073741789, 1))
1182     assert_equal(Rational(1152921512123039718, 1073741827),
1183                  Rational(1073741789, 1073741827) + Rational(1073741827, 1))
1184     assert_equal(Rational(-1152921509975556140, 1073741827),
1185                  Rational(1073741789, 1073741827) - Rational(1073741827, 1))
1186     assert_equal(Rational(1073741789, 1),
1187                  Rational(1073741789, 1073741827) * Rational(1073741827, 1))
1188     assert_equal(Rational(1073741789, 1152921511049297929),
1189                  Rational(1073741789, 1073741827) / Rational(1073741827, 1))
1190     assert_equal(Rational(5368709021, 3221225481),
1191                  Rational(1073741789, 1073741827) + Rational(2, 3))
1192     assert_equal(Rational(1073741713, 3221225481),
1193                  Rational(1073741789, 1073741827) - Rational(2, 3))
1194     assert_equal(Rational(2147483578, 3221225481),
1195                  Rational(1073741789, 1073741827) * Rational(2, 3))
1196     assert_equal(Rational(3221225367, 2147483654),
1197                  Rational(1073741789, 1073741827) / Rational(2, 3))
1198     assert_equal(Rational(5368709059, 2147483654),
1199                  Rational(1073741789, 1073741827) + Rational(3, 2))
1200     assert_equal(Rational(-1073741903, 2147483654),
1201                  Rational(1073741789, 1073741827) - Rational(3, 2))
1202     assert_equal(Rational(3221225367, 2147483654),
1203                  Rational(1073741789, 1073741827) * Rational(3, 2))
1204     assert_equal(Rational(2147483578, 3221225481),
1205                  Rational(1073741789, 1073741827) / Rational(3, 2))
1206     assert_equal(Rational(1152921432666146002, 1152921470247108503),
1207                  Rational(1073741789, 1073741827) + Rational(3, 1073741789))
1208     assert_equal(Rational(1152921426223695040, 1152921470247108503),
1209                  Rational(1073741789, 1073741827) - Rational(3, 1073741789))
1210     assert_equal(Rational(3, 1073741827),
1211                  Rational(1073741789, 1073741827) * Rational(3, 1073741789))
1212     assert_equal(Rational(1152921429444920521, 3221225481),
1213                  Rational(1073741789, 1073741827) / Rational(3, 1073741789))
1214     assert_equal(Rational(1152921473468333870, 3221225481),
1215                  Rational(1073741789, 1073741827) + Rational(1073741789, 3))
1216     assert_equal(Rational(-1152921467025883136, 3221225481),
1217                  Rational(1073741789, 1073741827) - Rational(1073741789, 3))
1218     assert_equal(Rational(1152921429444920521, 3221225481),
1219                  Rational(1073741789, 1073741827) * Rational(1073741789, 3))
1220     assert_equal(Rational(3, 1073741827),
1221                  Rational(1073741789, 1073741827) / Rational(1073741789, 3))
1222     assert_equal(Rational(1073741792, 1073741827),
1223                  Rational(1073741789, 1073741827) + Rational(3, 1073741827))
1224     assert_equal(Rational(1073741786, 1073741827),
1225                  Rational(1073741789, 1073741827) - Rational(3, 1073741827))
1226     assert_equal(Rational(3221225367, 1152921511049297929),
1227                  Rational(1073741789, 1073741827) * Rational(3, 1073741827))
1228     assert_equal(Rational(1073741789, 3),
1229                  Rational(1073741789, 1073741827) / Rational(3, 1073741827))
1230     assert_equal(Rational(1152921514270523296, 3221225481),
1231                  Rational(1073741789, 1073741827) + Rational(1073741827, 3))
1232     assert_equal(Rational(-1152921507828072562, 3221225481),
1233                  Rational(1073741789, 1073741827) - Rational(1073741827, 3))
1234     assert_equal(Rational(1073741789, 3),
1235                  Rational(1073741789, 1073741827) * Rational(1073741827, 3))
1236     assert_equal(Rational(3221225367, 1152921511049297929),
1237                  Rational(1073741789, 1073741827) / Rational(1073741827, 3))
1238     assert_equal(Rational(2147483578, 1073741827),
1239                  Rational(1073741789, 1073741827) + Rational(1073741789, 1073741827))
1240     assert_equal(Rational(0, 1),
1241                  Rational(1073741789, 1073741827) - Rational(1073741789, 1073741827))
1242     assert_equal(Rational(1152921429444920521, 1152921511049297929),
1243                  Rational(1073741789, 1073741827) * Rational(1073741789, 1073741827))
1244     assert_equal(Rational(1, 1),
1245                  Rational(1073741789, 1073741827) / Rational(1073741789, 1073741827))
1246     assert_equal(Rational(2305842940494218450, 1152921470247108503),
1247                  Rational(1073741789, 1073741827) + Rational(1073741827, 1073741789))
1248     assert_equal(Rational(-81604377408, 1152921470247108503),
1249                  Rational(1073741789, 1073741827) - Rational(1073741827, 1073741789))
1250     assert_equal(Rational(1, 1),
1251                  Rational(1073741789, 1073741827) * Rational(1073741827, 1073741789))
1252     assert_equal(Rational(1152921429444920521, 1152921511049297929),
1253                  Rational(1073741789, 1073741827) / Rational(1073741827, 1073741789))
1254     assert_equal(Rational(2147483616, 1073741789),
1255                  Rational(1073741827, 1073741789) + Rational(1, 1))
1256     assert_equal(Rational(38, 1073741789),
1257                  Rational(1073741827, 1073741789) - Rational(1, 1))
1258     assert_equal(Rational(1073741827, 1073741789),
1259                  Rational(1073741827, 1073741789) * Rational(1, 1))
1260     assert_equal(Rational(1073741827, 1073741789),
1261                  Rational(1073741827, 1073741789) / Rational(1, 1))
1262     assert_equal(Rational(3221225405, 1073741789),
1263                  Rational(1073741827, 1073741789) + Rational(2, 1))
1264     assert_equal(Rational(-1073741751, 1073741789),
1265                  Rational(1073741827, 1073741789) - Rational(2, 1))
1266     assert_equal(Rational(2147483654, 1073741789),
1267                  Rational(1073741827, 1073741789) * Rational(2, 1))
1268     assert_equal(Rational(1073741827, 2147483578),
1269                  Rational(1073741827, 1073741789) / Rational(2, 1))
1270     assert_equal(Rational(4294967194, 1073741789),
1271                  Rational(1073741827, 1073741789) + Rational(3, 1))
1272     assert_equal(Rational(-2147483540, 1073741789),
1273                  Rational(1073741827, 1073741789) - Rational(3, 1))
1274     assert_equal(Rational(3221225481, 1073741789),
1275                  Rational(1073741827, 1073741789) * Rational(3, 1))
1276     assert_equal(Rational(1073741827, 3221225367),
1277                  Rational(1073741827, 1073741789) / Rational(3, 1))
1278     assert_equal(Rational(1152921430518662348, 1073741789),
1279                  Rational(1073741827, 1073741789) + Rational(1073741789, 1))
1280     assert_equal(Rational(-1152921428371178694, 1073741789),
1281                  Rational(1073741827, 1073741789) - Rational(1073741789, 1))
1282     assert_equal(Rational(1073741827, 1),
1283                  Rational(1073741827, 1073741789) * Rational(1073741789, 1))
1284     assert_equal(Rational(1073741827, 1152921429444920521),
1285                  Rational(1073741827, 1073741789) / Rational(1073741789, 1))
1286     assert_equal(Rational(1152921471320850330, 1073741789),
1287                  Rational(1073741827, 1073741789) + Rational(1073741827, 1))
1288     assert_equal(Rational(-1152921469173366676, 1073741789),
1289                  Rational(1073741827, 1073741789) - Rational(1073741827, 1))
1290     assert_equal(Rational(1152921511049297929, 1073741789),
1291                  Rational(1073741827, 1073741789) * Rational(1073741827, 1))
1292     assert_equal(Rational(1, 1073741789),
1293                  Rational(1073741827, 1073741789) / Rational(1073741827, 1))
1294     assert_equal(Rational(5368709059, 3221225367),
1295                  Rational(1073741827, 1073741789) + Rational(2, 3))
1296     assert_equal(Rational(1073741903, 3221225367),
1297                  Rational(1073741827, 1073741789) - Rational(2, 3))
1298     assert_equal(Rational(2147483654, 3221225367),
1299                  Rational(1073741827, 1073741789) * Rational(2, 3))
1300     assert_equal(Rational(3221225481, 2147483578),
1301                  Rational(1073741827, 1073741789) / Rational(2, 3))
1302     assert_equal(Rational(5368709021, 2147483578),
1303                  Rational(1073741827, 1073741789) + Rational(3, 2))
1304     assert_equal(Rational(-1073741713, 2147483578),
1305                  Rational(1073741827, 1073741789) - Rational(3, 2))
1306     assert_equal(Rational(3221225481, 2147483578),
1307                  Rational(1073741827, 1073741789) * Rational(3, 2))
1308     assert_equal(Rational(2147483654, 3221225367),
1309                  Rational(1073741827, 1073741789) / Rational(3, 2))
1310     assert_equal(Rational(1073741830, 1073741789),
1311                  Rational(1073741827, 1073741789) + Rational(3, 1073741789))
1312     assert_equal(Rational(1073741824, 1073741789),
1313                  Rational(1073741827, 1073741789) - Rational(3, 1073741789))
1314     assert_equal(Rational(3221225481, 1152921429444920521),
1315                  Rational(1073741827, 1073741789) * Rational(3, 1073741789))
1316     assert_equal(Rational(1073741827, 3),
1317                  Rational(1073741827, 1073741789) / Rational(3, 1073741789))
1318     assert_equal(Rational(1152921432666146002, 3221225367),
1319                  Rational(1073741827, 1073741789) + Rational(1073741789, 3))
1320     assert_equal(Rational(-1152921426223695040, 3221225367),
1321                  Rational(1073741827, 1073741789) - Rational(1073741789, 3))
1322     assert_equal(Rational(1073741827, 3),
1323                  Rational(1073741827, 1073741789) * Rational(1073741789, 3))
1324     assert_equal(Rational(3221225481, 1152921429444920521),
1325                  Rational(1073741827, 1073741789) / Rational(1073741789, 3))
1326     assert_equal(Rational(1152921514270523296, 1152921470247108503),
1327                  Rational(1073741827, 1073741789) + Rational(3, 1073741827))
1328     assert_equal(Rational(1152921507828072562, 1152921470247108503),
1329                  Rational(1073741827, 1073741789) - Rational(3, 1073741827))
1330     assert_equal(Rational(3, 1073741789),
1331                  Rational(1073741827, 1073741789) * Rational(3, 1073741827))
1332     assert_equal(Rational(1152921511049297929, 3221225367),
1333                  Rational(1073741827, 1073741789) / Rational(3, 1073741827))
1334     assert_equal(Rational(1152921473468333984, 3221225367),
1335                  Rational(1073741827, 1073741789) + Rational(1073741827, 3))
1336     assert_equal(Rational(-1152921467025883022, 3221225367),
1337                  Rational(1073741827, 1073741789) - Rational(1073741827, 3))
1338     assert_equal(Rational(1152921511049297929, 3221225367),
1339                  Rational(1073741827, 1073741789) * Rational(1073741827, 3))
1340     assert_equal(Rational(3, 1073741789),
1341                  Rational(1073741827, 1073741789) / Rational(1073741827, 3))
1342     assert_equal(Rational(2305842940494218450, 1152921470247108503),
1343                  Rational(1073741827, 1073741789) + Rational(1073741789, 1073741827))
1344     assert_equal(Rational(81604377408, 1152921470247108503),
1345                  Rational(1073741827, 1073741789) - Rational(1073741789, 1073741827))
1346     assert_equal(Rational(1, 1),
1347                  Rational(1073741827, 1073741789) * Rational(1073741789, 1073741827))
1348     assert_equal(Rational(1152921511049297929, 1152921429444920521),
1349                  Rational(1073741827, 1073741789) / Rational(1073741789, 1073741827))
1350     assert_equal(Rational(2147483654, 1073741789),
1351                  Rational(1073741827, 1073741789) + Rational(1073741827, 1073741789))
1352     assert_equal(Rational(0, 1),
1353                  Rational(1073741827, 1073741789) - Rational(1073741827, 1073741789))
1354     assert_equal(Rational(1152921511049297929, 1152921429444920521),
1355                  Rational(1073741827, 1073741789) * Rational(1073741827, 1073741789))
1356     assert_equal(Rational(1, 1),
1357                  Rational(1073741827, 1073741789) / Rational(1073741827, 1073741789))
1358   end