PageRenderTime 47ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 1ms

/projects/jruby-1.7.3/test/externals/ruby1.9/ruby/test_complex2.rb

https://gitlab.com/essere.lab.public/qualitas.class-corpus
Ruby | 578 lines | 575 code | 3 blank | 0 comment | 0 complexity | b297ea2fc61eaabbd8323959491e499b MD5 | raw file
  1. require 'test/unit'
  2. class Complex_Test2 < Test::Unit::TestCase
  3. def test_kumi
  4. skip unless defined?(Rational)
  5. assert_equal(Complex(1, 0), +Complex(1, 0))
  6. assert_equal(Complex(-1, 0), -Complex(1, 0))
  7. assert_equal(Complex(2, 0),
  8. Complex(1, 0) + Complex(1, 0))
  9. assert_equal(Complex(0, 0),
  10. Complex(1, 0) - Complex(1, 0))
  11. assert_equal(Complex(1, 0),
  12. Complex(1, 0) * Complex(1, 0))
  13. assert_equal(Complex(1, 0),
  14. Complex(1, 0) / Complex(1, 0))
  15. assert_equal(Complex(1073741790, 0),
  16. Complex(1, 0) + Complex(1073741789, 0))
  17. assert_equal(Complex(-1073741788, 0),
  18. Complex(1, 0) - Complex(1073741789, 0))
  19. assert_equal(Complex(1073741789, 0),
  20. Complex(1, 0) * Complex(1073741789, 0))
  21. assert_equal(Complex(Rational(1, 1073741789), 0),
  22. Complex(1, 0) / Complex(1073741789, 0))
  23. assert_equal(Complex(1073741828, 0),
  24. Complex(1, 0) + Complex(1073741827, 0))
  25. assert_equal(Complex(-1073741826, 0),
  26. Complex(1, 0) - Complex(1073741827, 0))
  27. assert_equal(Complex(1073741827, 0),
  28. Complex(1, 0) * Complex(1073741827, 0))
  29. assert_equal(Complex(Rational(1, 1073741827), 0),
  30. Complex(1, 0) / Complex(1073741827, 0))
  31. assert_equal(Complex(1073741790, 1073741789),
  32. Complex(1, 0) + Complex(1073741789, 1073741789))
  33. assert_equal(Complex(-1073741788, -1073741789),
  34. Complex(1, 0) - Complex(1073741789, 1073741789))
  35. assert_equal(Complex(1073741789, 1073741789),
  36. Complex(1, 0) * Complex(1073741789, 1073741789))
  37. assert_equal(Complex(Rational(1, 2147483578), Rational(-1, 2147483578)),
  38. Complex(1, 0) / Complex(1073741789, 1073741789))
  39. assert_equal(Complex(1073741790, 1073741827),
  40. Complex(1, 0) + Complex(1073741789, 1073741827))
  41. assert_equal(Complex(-1073741788, -1073741827),
  42. Complex(1, 0) - Complex(1073741789, 1073741827))
  43. assert_equal(Complex(1073741789, 1073741827),
  44. Complex(1, 0) * Complex(1073741789, 1073741827))
  45. assert_equal(Complex(Rational(1073741789, 2305842940494218450), Rational(-1073741827, 2305842940494218450)),
  46. Complex(1, 0) / Complex(1073741789, 1073741827))
  47. assert_equal(Complex(1073741828, 1073741827),
  48. Complex(1, 0) + Complex(1073741827, 1073741827))
  49. assert_equal(Complex(-1073741826, -1073741827),
  50. Complex(1, 0) - Complex(1073741827, 1073741827))
  51. assert_equal(Complex(1073741827, 1073741827),
  52. Complex(1, 0) * Complex(1073741827, 1073741827))
  53. assert_equal(Complex(Rational(1, 2147483654), Rational(-1, 2147483654)),
  54. Complex(1, 0) / Complex(1073741827, 1073741827))
  55. assert_equal(Complex(Rational(2147483616, 1073741827), Rational(1073741789, 1073741827)),
  56. Complex(1, 0) + Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  57. assert_equal(Complex(Rational(38, 1073741827), Rational(-1073741789, 1073741827)),
  58. Complex(1, 0) - Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  59. assert_equal(Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)),
  60. Complex(1, 0) * Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  61. assert_equal(Complex(Rational(1073741827, 2147483578), Rational(-1073741827, 2147483578)),
  62. Complex(1, 0) / Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  63. assert_equal(Complex(Rational(2147483616, 1073741789), Rational(1073741827, 1073741789)),
  64. Complex(1, 0) + Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  65. assert_equal(Complex(Rational(-38, 1073741789), Rational(-1073741827, 1073741789)),
  66. Complex(1, 0) - Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  67. assert_equal(Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)),
  68. Complex(1, 0) * Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  69. assert_equal(Complex(Rational(1073741789, 2147483654), Rational(-1073741789, 2147483654)),
  70. Complex(1, 0) / Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  71. assert_equal(Complex(Rational(2147483616, 1073741827), Rational(1073741827, 1073741789)),
  72. Complex(1, 0) + Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  73. assert_equal(Complex(Rational(38, 1073741827), Rational(-1073741827, 1073741789)),
  74. Complex(1, 0) - Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  75. assert_equal(Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)),
  76. Complex(1, 0) * Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  77. assert_equal(Complex(Rational(1329227869515035739611240300898290063, 2658455833113515253509575011810600482), Rational(-1329227963598474519442525600436190287, 2658455833113515253509575011810600482)),
  78. Complex(1, 0) / Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  79. assert_equal(Complex(1073741789, 0), +Complex(1073741789, 0))
  80. assert_equal(Complex(-1073741789, 0), -Complex(1073741789, 0))
  81. assert_equal(Complex(1073741790, 0),
  82. Complex(1073741789, 0) + Complex(1, 0))
  83. assert_equal(Complex(1073741788, 0),
  84. Complex(1073741789, 0) - Complex(1, 0))
  85. assert_equal(Complex(1073741789, 0),
  86. Complex(1073741789, 0) * Complex(1, 0))
  87. assert_equal(Complex(1073741789, 0),
  88. Complex(1073741789, 0) / Complex(1, 0))
  89. assert_equal(Complex(2147483578, 0),
  90. Complex(1073741789, 0) + Complex(1073741789, 0))
  91. assert_equal(Complex(0, 0),
  92. Complex(1073741789, 0) - Complex(1073741789, 0))
  93. assert_equal(Complex(1152921429444920521, 0),
  94. Complex(1073741789, 0) * Complex(1073741789, 0))
  95. assert_equal(Complex(1, 0),
  96. Complex(1073741789, 0) / Complex(1073741789, 0))
  97. assert_equal(Complex(2147483616, 0),
  98. Complex(1073741789, 0) + Complex(1073741827, 0))
  99. assert_equal(Complex(-38, 0),
  100. Complex(1073741789, 0) - Complex(1073741827, 0))
  101. assert_equal(Complex(1152921470247108503, 0),
  102. Complex(1073741789, 0) * Complex(1073741827, 0))
  103. assert_equal(Complex(Rational(1073741789, 1073741827), 0),
  104. Complex(1073741789, 0) / Complex(1073741827, 0))
  105. assert_equal(Complex(2147483578, 1073741789),
  106. Complex(1073741789, 0) + Complex(1073741789, 1073741789))
  107. assert_equal(Complex(0, -1073741789),
  108. Complex(1073741789, 0) - Complex(1073741789, 1073741789))
  109. assert_equal(Complex(1152921429444920521, 1152921429444920521),
  110. Complex(1073741789, 0) * Complex(1073741789, 1073741789))
  111. assert_equal(Complex(Rational(1, 2), Rational(-1, 2)),
  112. Complex(1073741789, 0) / Complex(1073741789, 1073741789))
  113. assert_equal(Complex(2147483578, 1073741827),
  114. Complex(1073741789, 0) + Complex(1073741789, 1073741827))
  115. assert_equal(Complex(0, -1073741827),
  116. Complex(1073741789, 0) - Complex(1073741789, 1073741827))
  117. assert_equal(Complex(1152921429444920521, 1152921470247108503),
  118. Complex(1073741789, 0) * Complex(1073741789, 1073741827))
  119. assert_equal(Complex(Rational(1152921429444920521, 2305842940494218450), Rational(-1152921470247108503, 2305842940494218450)),
  120. Complex(1073741789, 0) / Complex(1073741789, 1073741827))
  121. assert_equal(Complex(2147483616, 1073741827),
  122. Complex(1073741789, 0) + Complex(1073741827, 1073741827))
  123. assert_equal(Complex(-38, -1073741827),
  124. Complex(1073741789, 0) - Complex(1073741827, 1073741827))
  125. assert_equal(Complex(1152921470247108503, 1152921470247108503),
  126. Complex(1073741789, 0) * Complex(1073741827, 1073741827))
  127. assert_equal(Complex(Rational(1073741789, 2147483654), Rational(-1073741789, 2147483654)),
  128. Complex(1073741789, 0) / Complex(1073741827, 1073741827))
  129. assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1073741789, 1073741827)),
  130. Complex(1073741789, 0) + Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  131. assert_equal(Complex(Rational(1152921469173366714, 1073741827), Rational(-1073741789, 1073741827)),
  132. Complex(1073741789, 0) - Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  133. assert_equal(Complex(Rational(1152921429444920521, 1073741827), Rational(1152921429444920521, 1073741827)),
  134. Complex(1073741789, 0) * Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  135. assert_equal(Complex(Rational(1073741827, 2), Rational(-1073741827, 2)),
  136. Complex(1073741789, 0) / Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  137. assert_equal(Complex(Rational(1152921430518662348, 1073741789), Rational(1073741827, 1073741789)),
  138. Complex(1073741789, 0) + Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  139. assert_equal(Complex(Rational(1152921428371178694, 1073741789), Rational(-1073741827, 1073741789)),
  140. Complex(1073741789, 0) - Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  141. assert_equal(Complex(1073741827, 1073741827),
  142. Complex(1073741789, 0) * Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  143. assert_equal(Complex(Rational(1152921429444920521, 2147483654), Rational(-1152921429444920521, 2147483654)),
  144. Complex(1073741789, 0) / Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  145. assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1073741827, 1073741789)),
  146. Complex(1073741789, 0) + Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  147. assert_equal(Complex(Rational(1152921469173366714, 1073741827), Rational(-1073741827, 1073741789)),
  148. Complex(1073741789, 0) - Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  149. assert_equal(Complex(Rational(1152921429444920521, 1073741827), 1073741827),
  150. Complex(1073741789, 0) * Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  151. assert_equal(Complex(Rational(1427247510601733037449111325195428279286542707, 2658455833113515253509575011810600482), Rational(-1427247611623052908177132720890654139107803443, 2658455833113515253509575011810600482)),
  152. Complex(1073741789, 0) / Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  153. assert_equal(Complex(1073741827, 0), +Complex(1073741827, 0))
  154. assert_equal(Complex(-1073741827, 0), -Complex(1073741827, 0))
  155. assert_equal(Complex(1073741828, 0),
  156. Complex(1073741827, 0) + Complex(1, 0))
  157. assert_equal(Complex(1073741826, 0),
  158. Complex(1073741827, 0) - Complex(1, 0))
  159. assert_equal(Complex(1073741827, 0),
  160. Complex(1073741827, 0) * Complex(1, 0))
  161. assert_equal(Complex(1073741827, 0),
  162. Complex(1073741827, 0) / Complex(1, 0))
  163. assert_equal(Complex(2147483616, 0),
  164. Complex(1073741827, 0) + Complex(1073741789, 0))
  165. assert_equal(Complex(38, 0),
  166. Complex(1073741827, 0) - Complex(1073741789, 0))
  167. assert_equal(Complex(1152921470247108503, 0),
  168. Complex(1073741827, 0) * Complex(1073741789, 0))
  169. assert_equal(Complex(Rational(1073741827, 1073741789), 0),
  170. Complex(1073741827, 0) / Complex(1073741789, 0))
  171. assert_equal(Complex(2147483654, 0),
  172. Complex(1073741827, 0) + Complex(1073741827, 0))
  173. assert_equal(Complex(0, 0),
  174. Complex(1073741827, 0) - Complex(1073741827, 0))
  175. assert_equal(Complex(1152921511049297929, 0),
  176. Complex(1073741827, 0) * Complex(1073741827, 0))
  177. assert_equal(Complex(1, 0),
  178. Complex(1073741827, 0) / Complex(1073741827, 0))
  179. assert_equal(Complex(2147483616, 1073741789),
  180. Complex(1073741827, 0) + Complex(1073741789, 1073741789))
  181. assert_equal(Complex(38, -1073741789),
  182. Complex(1073741827, 0) - Complex(1073741789, 1073741789))
  183. assert_equal(Complex(1152921470247108503, 1152921470247108503),
  184. Complex(1073741827, 0) * Complex(1073741789, 1073741789))
  185. assert_equal(Complex(Rational(1073741827, 2147483578), Rational(-1073741827, 2147483578)),
  186. Complex(1073741827, 0) / Complex(1073741789, 1073741789))
  187. assert_equal(Complex(2147483616, 1073741827),
  188. Complex(1073741827, 0) + Complex(1073741789, 1073741827))
  189. assert_equal(Complex(38, -1073741827),
  190. Complex(1073741827, 0) - Complex(1073741789, 1073741827))
  191. assert_equal(Complex(1152921470247108503, 1152921511049297929),
  192. Complex(1073741827, 0) * Complex(1073741789, 1073741827))
  193. assert_equal(Complex(Rational(1152921470247108503, 2305842940494218450), Rational(-1152921511049297929, 2305842940494218450)),
  194. Complex(1073741827, 0) / Complex(1073741789, 1073741827))
  195. assert_equal(Complex(2147483654, 1073741827),
  196. Complex(1073741827, 0) + Complex(1073741827, 1073741827))
  197. assert_equal(Complex(0, -1073741827),
  198. Complex(1073741827, 0) - Complex(1073741827, 1073741827))
  199. assert_equal(Complex(1152921511049297929, 1152921511049297929),
  200. Complex(1073741827, 0) * Complex(1073741827, 1073741827))
  201. assert_equal(Complex(Rational(1, 2), Rational(-1, 2)),
  202. Complex(1073741827, 0) / Complex(1073741827, 1073741827))
  203. assert_equal(Complex(Rational(1152921512123039718, 1073741827), Rational(1073741789, 1073741827)),
  204. Complex(1073741827, 0) + Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  205. assert_equal(Complex(Rational(1152921509975556140, 1073741827), Rational(-1073741789, 1073741827)),
  206. Complex(1073741827, 0) - Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  207. assert_equal(Complex(1073741789, 1073741789),
  208. Complex(1073741827, 0) * Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  209. assert_equal(Complex(Rational(1152921511049297929, 2147483578), Rational(-1152921511049297929, 2147483578)),
  210. Complex(1073741827, 0) / Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  211. assert_equal(Complex(Rational(1152921471320850330, 1073741789), Rational(1073741827, 1073741789)),
  212. Complex(1073741827, 0) + Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  213. assert_equal(Complex(Rational(1152921469173366676, 1073741789), Rational(-1073741827, 1073741789)),
  214. Complex(1073741827, 0) - Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  215. assert_equal(Complex(Rational(1152921511049297929, 1073741789), Rational(1152921511049297929, 1073741789)),
  216. Complex(1073741827, 0) * Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  217. assert_equal(Complex(Rational(1073741789, 2), Rational(-1073741789, 2)),
  218. Complex(1073741827, 0) / Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  219. assert_equal(Complex(Rational(1152921512123039718, 1073741827), Rational(1073741827, 1073741789)),
  220. Complex(1073741827, 0) + Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  221. assert_equal(Complex(Rational(1152921509975556140, 1073741827), Rational(-1073741827, 1073741789)),
  222. Complex(1073741827, 0) - Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  223. assert_equal(Complex(1073741789, Rational(1152921511049297929, 1073741789)),
  224. Complex(1073741827, 0) * Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  225. assert_equal(Complex(Rational(1427247561112392079020469430422559713421565101, 2658455833113515253509575011810600482), Rational(-1427247662133715524919164459706626955683034349, 2658455833113515253509575011810600482)),
  226. Complex(1073741827, 0) / Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  227. assert_equal(Complex(1073741789, 1073741789), +Complex(1073741789, 1073741789))
  228. assert_equal(Complex(-1073741789, -1073741789), -Complex(1073741789, 1073741789))
  229. assert_equal(Complex(1073741790, 1073741789),
  230. Complex(1073741789, 1073741789) + Complex(1, 0))
  231. assert_equal(Complex(1073741788, 1073741789),
  232. Complex(1073741789, 1073741789) - Complex(1, 0))
  233. assert_equal(Complex(1073741789, 1073741789),
  234. Complex(1073741789, 1073741789) * Complex(1, 0))
  235. assert_equal(Complex(1073741789, 1073741789),
  236. Complex(1073741789, 1073741789) / Complex(1, 0))
  237. assert_equal(Complex(2147483578, 1073741789),
  238. Complex(1073741789, 1073741789) + Complex(1073741789, 0))
  239. assert_equal(Complex(0, 1073741789),
  240. Complex(1073741789, 1073741789) - Complex(1073741789, 0))
  241. assert_equal(Complex(1152921429444920521, 1152921429444920521),
  242. Complex(1073741789, 1073741789) * Complex(1073741789, 0))
  243. assert_equal(Complex(1, 1),
  244. Complex(1073741789, 1073741789) / Complex(1073741789, 0))
  245. assert_equal(Complex(2147483616, 1073741789),
  246. Complex(1073741789, 1073741789) + Complex(1073741827, 0))
  247. assert_equal(Complex(-38, 1073741789),
  248. Complex(1073741789, 1073741789) - Complex(1073741827, 0))
  249. assert_equal(Complex(1152921470247108503, 1152921470247108503),
  250. Complex(1073741789, 1073741789) * Complex(1073741827, 0))
  251. assert_equal(Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)),
  252. Complex(1073741789, 1073741789) / Complex(1073741827, 0))
  253. assert_equal(Complex(2147483578, 2147483578),
  254. Complex(1073741789, 1073741789) + Complex(1073741789, 1073741789))
  255. assert_equal(Complex(0, 0),
  256. Complex(1073741789, 1073741789) - Complex(1073741789, 1073741789))
  257. assert_equal(Complex(0, 2305842858889841042),
  258. Complex(1073741789, 1073741789) * Complex(1073741789, 1073741789))
  259. assert_equal(Complex(1, 0),
  260. Complex(1073741789, 1073741789) / Complex(1073741789, 1073741789))
  261. assert_equal(Complex(2147483578, 2147483616),
  262. Complex(1073741789, 1073741789) + Complex(1073741789, 1073741827))
  263. assert_equal(Complex(0, -38),
  264. Complex(1073741789, 1073741789) - Complex(1073741789, 1073741827))
  265. assert_equal(Complex(-40802187982, 2305842899692029024),
  266. Complex(1073741789, 1073741789) * Complex(1073741789, 1073741827))
  267. assert_equal(Complex(Rational(1152921449846014512, 1152921470247109225), Rational(-20401093991, 1152921470247109225)),
  268. Complex(1073741789, 1073741789) / Complex(1073741789, 1073741827))
  269. assert_equal(Complex(2147483616, 2147483616),
  270. Complex(1073741789, 1073741789) + Complex(1073741827, 1073741827))
  271. assert_equal(Complex(-38, -38),
  272. Complex(1073741789, 1073741789) - Complex(1073741827, 1073741827))
  273. assert_equal(Complex(0, 2305842940494217006),
  274. Complex(1073741789, 1073741789) * Complex(1073741827, 1073741827))
  275. assert_equal(Complex(Rational(1073741789, 1073741827), 0),
  276. Complex(1073741789, 1073741789) / Complex(1073741827, 1073741827))
  277. assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1152921471320850292, 1073741827)),
  278. Complex(1073741789, 1073741789) + Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  279. assert_equal(Complex(Rational(1152921469173366714, 1073741827), Rational(1152921469173366714, 1073741827)),
  280. Complex(1073741789, 1073741789) - Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  281. assert_equal(Complex(0, Rational(2305842858889841042, 1073741827)),
  282. Complex(1073741789, 1073741789) * Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  283. assert_equal(Complex(1073741827, 0),
  284. Complex(1073741789, 1073741789) / Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  285. assert_equal(Complex(Rational(1152921430518662348, 1073741789), Rational(1152921430518662348, 1073741789)),
  286. Complex(1073741789, 1073741789) + Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  287. assert_equal(Complex(Rational(1152921428371178694, 1073741789), Rational(1152921428371178694, 1073741789)),
  288. Complex(1073741789, 1073741789) - Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  289. assert_equal(Complex(0, 2147483654),
  290. Complex(1073741789, 1073741789) * Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  291. assert_equal(Complex(Rational(1152921429444920521, 1073741827), 0),
  292. Complex(1073741789, 1073741789) / Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  293. assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1152921430518662348, 1073741789)),
  294. Complex(1073741789, 1073741789) + Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  295. assert_equal(Complex(Rational(1152921469173366714, 1073741827), Rational(1152921428371178694, 1073741789)),
  296. Complex(1073741789, 1073741789) - Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  297. assert_equal(Complex(Rational(-81604377408, 1073741827), Rational(2305842940494218450, 1073741827)),
  298. Complex(1073741789, 1073741789) * Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  299. assert_equal(Complex(Rational(1427247561112392972813122023043041209197173075, 1329227916556757626754787505905300241), Rational(-50510659935364010697847612929910630368, 1329227916556757626754787505905300241)),
  300. Complex(1073741789, 1073741789) / Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  301. assert_equal(Complex(1073741789, 1073741827), +Complex(1073741789, 1073741827))
  302. assert_equal(Complex(-1073741789, -1073741827), -Complex(1073741789, 1073741827))
  303. assert_equal(Complex(1073741790, 1073741827),
  304. Complex(1073741789, 1073741827) + Complex(1, 0))
  305. assert_equal(Complex(1073741788, 1073741827),
  306. Complex(1073741789, 1073741827) - Complex(1, 0))
  307. assert_equal(Complex(1073741789, 1073741827),
  308. Complex(1073741789, 1073741827) * Complex(1, 0))
  309. assert_equal(Complex(1073741789, 1073741827),
  310. Complex(1073741789, 1073741827) / Complex(1, 0))
  311. assert_equal(Complex(2147483578, 1073741827),
  312. Complex(1073741789, 1073741827) + Complex(1073741789, 0))
  313. assert_equal(Complex(0, 1073741827),
  314. Complex(1073741789, 1073741827) - Complex(1073741789, 0))
  315. assert_equal(Complex(1152921429444920521, 1152921470247108503),
  316. Complex(1073741789, 1073741827) * Complex(1073741789, 0))
  317. assert_equal(Complex(1, Rational(1073741827, 1073741789)),
  318. Complex(1073741789, 1073741827) / Complex(1073741789, 0))
  319. assert_equal(Complex(2147483616, 1073741827),
  320. Complex(1073741789, 1073741827) + Complex(1073741827, 0))
  321. assert_equal(Complex(-38, 1073741827),
  322. Complex(1073741789, 1073741827) - Complex(1073741827, 0))
  323. assert_equal(Complex(1152921470247108503, 1152921511049297929),
  324. Complex(1073741789, 1073741827) * Complex(1073741827, 0))
  325. assert_equal(Complex(Rational(1073741789, 1073741827), 1),
  326. Complex(1073741789, 1073741827) / Complex(1073741827, 0))
  327. assert_equal(Complex(2147483578, 2147483616),
  328. Complex(1073741789, 1073741827) + Complex(1073741789, 1073741789))
  329. assert_equal(Complex(0, 38),
  330. Complex(1073741789, 1073741827) - Complex(1073741789, 1073741789))
  331. assert_equal(Complex(-40802187982, 2305842899692029024),
  332. Complex(1073741789, 1073741827) * Complex(1073741789, 1073741789))
  333. assert_equal(Complex(Rational(1073741808, 1073741789), Rational(19, 1073741789)),
  334. Complex(1073741789, 1073741827) / Complex(1073741789, 1073741789))
  335. assert_equal(Complex(2147483578, 2147483654),
  336. Complex(1073741789, 1073741827) + Complex(1073741789, 1073741827))
  337. assert_equal(Complex(0, 0),
  338. Complex(1073741789, 1073741827) - Complex(1073741789, 1073741827))
  339. assert_equal(Complex(-81604377408, 2305842940494217006),
  340. Complex(1073741789, 1073741827) * Complex(1073741789, 1073741827))
  341. assert_equal(Complex(1, 0),
  342. Complex(1073741789, 1073741827) / Complex(1073741789, 1073741827))
  343. assert_equal(Complex(2147483616, 2147483654),
  344. Complex(1073741789, 1073741827) + Complex(1073741827, 1073741827))
  345. assert_equal(Complex(-38, 0),
  346. Complex(1073741789, 1073741827) - Complex(1073741827, 1073741827))
  347. assert_equal(Complex(-40802189426, 2305842981296406432),
  348. Complex(1073741789, 1073741827) * Complex(1073741827, 1073741827))
  349. assert_equal(Complex(Rational(1073741808, 1073741827), Rational(19, 1073741827)),
  350. Complex(1073741789, 1073741827) / Complex(1073741827, 1073741827))
  351. assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1152921512123039718, 1073741827)),
  352. Complex(1073741789, 1073741827) + Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  353. assert_equal(Complex(Rational(1152921469173366714, 1073741827), Rational(1152921509975556140, 1073741827)),
  354. Complex(1073741789, 1073741827) - Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  355. assert_equal(Complex(Rational(-40802187982, 1073741827), Rational(2305842899692029024, 1073741827)),
  356. Complex(1073741789, 1073741827) * Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  357. assert_equal(Complex(Rational(1152921490648203216, 1073741789), Rational(20401094713, 1073741789)),
  358. Complex(1073741789, 1073741827) / Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  359. assert_equal(Complex(Rational(1152921430518662348, 1073741789), Rational(1152921471320850330, 1073741789)),
  360. Complex(1073741789, 1073741827) + Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  361. assert_equal(Complex(Rational(1152921428371178694, 1073741789), Rational(1152921469173366676, 1073741789)),
  362. Complex(1073741789, 1073741827) - Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  363. assert_equal(Complex(Rational(-40802189426, 1073741789), Rational(2305842981296406432, 1073741789)),
  364. Complex(1073741789, 1073741827) * Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  365. assert_equal(Complex(Rational(1152921449846014512, 1073741827), Rational(20401093991, 1073741827)),
  366. Complex(1073741789, 1073741827) / Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  367. assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1152921471320850330, 1073741789)),
  368. Complex(1073741789, 1073741827) + Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  369. assert_equal(Complex(Rational(1152921469173366714, 1073741827), Rational(1152921469173366676, 1073741789)),
  370. Complex(1073741789, 1073741827) - Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  371. assert_equal(Complex(Rational(-131433047608170424214, 1152921470247108503), 2147483616),
  372. Complex(1073741789, 1073741827) * Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  373. assert_equal(Complex(Rational(1427247586367724281184137892451027617484788528, 1329227916556757626754787505905300241), Rational(-25255330414578331645234047212843119171, 1329227916556757626754787505905300241)),
  374. Complex(1073741789, 1073741827) / Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  375. assert_equal(Complex(1073741827, 1073741827), +Complex(1073741827, 1073741827))
  376. assert_equal(Complex(-1073741827, -1073741827), -Complex(1073741827, 1073741827))
  377. assert_equal(Complex(1073741828, 1073741827),
  378. Complex(1073741827, 1073741827) + Complex(1, 0))
  379. assert_equal(Complex(1073741826, 1073741827),
  380. Complex(1073741827, 1073741827) - Complex(1, 0))
  381. assert_equal(Complex(1073741827, 1073741827),
  382. Complex(1073741827, 1073741827) * Complex(1, 0))
  383. assert_equal(Complex(1073741827, 1073741827),
  384. Complex(1073741827, 1073741827) / Complex(1, 0))
  385. assert_equal(Complex(2147483616, 1073741827),
  386. Complex(1073741827, 1073741827) + Complex(1073741789, 0))
  387. assert_equal(Complex(38, 1073741827),
  388. Complex(1073741827, 1073741827) - Complex(1073741789, 0))
  389. assert_equal(Complex(1152921470247108503, 1152921470247108503),
  390. Complex(1073741827, 1073741827) * Complex(1073741789, 0))
  391. assert_equal(Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)),
  392. Complex(1073741827, 1073741827) / Complex(1073741789, 0))
  393. assert_equal(Complex(2147483654, 1073741827),
  394. Complex(1073741827, 1073741827) + Complex(1073741827, 0))
  395. assert_equal(Complex(0, 1073741827),
  396. Complex(1073741827, 1073741827) - Complex(1073741827, 0))
  397. assert_equal(Complex(1152921511049297929, 1152921511049297929),
  398. Complex(1073741827, 1073741827) * Complex(1073741827, 0))
  399. assert_equal(Complex(1, 1),
  400. Complex(1073741827, 1073741827) / Complex(1073741827, 0))
  401. assert_equal(Complex(2147483616, 2147483616),
  402. Complex(1073741827, 1073741827) + Complex(1073741789, 1073741789))
  403. assert_equal(Complex(38, 38),
  404. Complex(1073741827, 1073741827) - Complex(1073741789, 1073741789))
  405. assert_equal(Complex(0, 2305842940494217006),
  406. Complex(1073741827, 1073741827) * Complex(1073741789, 1073741789))
  407. assert_equal(Complex(Rational(1073741827, 1073741789), 0),
  408. Complex(1073741827, 1073741827) / Complex(1073741789, 1073741789))
  409. assert_equal(Complex(2147483616, 2147483654),
  410. Complex(1073741827, 1073741827) + Complex(1073741789, 1073741827))
  411. assert_equal(Complex(38, 0),
  412. Complex(1073741827, 1073741827) - Complex(1073741789, 1073741827))
  413. assert_equal(Complex(-40802189426, 2305842981296406432),
  414. Complex(1073741827, 1073741827) * Complex(1073741789, 1073741827))
  415. assert_equal(Complex(Rational(1152921490648203216, 1152921470247109225), Rational(-20401094713, 1152921470247109225)),
  416. Complex(1073741827, 1073741827) / Complex(1073741789, 1073741827))
  417. assert_equal(Complex(2147483654, 2147483654),
  418. Complex(1073741827, 1073741827) + Complex(1073741827, 1073741827))
  419. assert_equal(Complex(0, 0),
  420. Complex(1073741827, 1073741827) - Complex(1073741827, 1073741827))
  421. assert_equal(Complex(0, 2305843022098595858),
  422. Complex(1073741827, 1073741827) * Complex(1073741827, 1073741827))
  423. assert_equal(Complex(1, 0),
  424. Complex(1073741827, 1073741827) / Complex(1073741827, 1073741827))
  425. assert_equal(Complex(Rational(1152921512123039718, 1073741827), Rational(1152921512123039718, 1073741827)),
  426. Complex(1073741827, 1073741827) + Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  427. assert_equal(Complex(Rational(1152921509975556140, 1073741827), Rational(1152921509975556140, 1073741827)),
  428. Complex(1073741827, 1073741827) - Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  429. assert_equal(Complex(0, 2147483578),
  430. Complex(1073741827, 1073741827) * Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  431. assert_equal(Complex(Rational(1152921511049297929, 1073741789), 0),
  432. Complex(1073741827, 1073741827) / Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  433. assert_equal(Complex(Rational(1152921471320850330, 1073741789), Rational(1152921471320850330, 1073741789)),
  434. Complex(1073741827, 1073741827) + Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  435. assert_equal(Complex(Rational(1152921469173366676, 1073741789), Rational(1152921469173366676, 1073741789)),
  436. Complex(1073741827, 1073741827) - Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  437. assert_equal(Complex(0, Rational(2305843022098595858, 1073741789)),
  438. Complex(1073741827, 1073741827) * Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  439. assert_equal(Complex(1073741789, 0),
  440. Complex(1073741827, 1073741827) / Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  441. assert_equal(Complex(Rational(1152921512123039718, 1073741827), Rational(1152921471320850330, 1073741789)),
  442. Complex(1073741827, 1073741827) + Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  443. assert_equal(Complex(Rational(1152921509975556140, 1073741827), Rational(1152921469173366676, 1073741789)),
  444. Complex(1073741827, 1073741827) - Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  445. assert_equal(Complex(Rational(-81604377408, 1073741789), Rational(2305842940494218450, 1073741789)),
  446. Complex(1073741827, 1073741827) * Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  447. assert_equal(Complex(Rational(1427247611623053801969816945064593334552299725, 1329227916556757626754787505905300241), Rational(-50510661722949347514642033621130734624, 1329227916556757626754787505905300241)),
  448. Complex(1073741827, 1073741827) / Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  449. assert_equal(Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)), +Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  450. assert_equal(Complex(Rational(-1073741789, 1073741827), Rational(-1073741789, 1073741827)), -Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  451. assert_equal(Complex(Rational(2147483616, 1073741827), Rational(1073741789, 1073741827)),
  452. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) + Complex(1, 0))
  453. assert_equal(Complex(Rational(-38, 1073741827), Rational(1073741789, 1073741827)),
  454. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) - Complex(1, 0))
  455. assert_equal(Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)),
  456. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) * Complex(1, 0))
  457. assert_equal(Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)),
  458. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) / Complex(1, 0))
  459. assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1073741789, 1073741827)),
  460. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) + Complex(1073741789, 0))
  461. assert_equal(Complex(Rational(-1152921469173366714, 1073741827), Rational(1073741789, 1073741827)),
  462. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) - Complex(1073741789, 0))
  463. assert_equal(Complex(Rational(1152921429444920521, 1073741827), Rational(1152921429444920521, 1073741827)),
  464. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) * Complex(1073741789, 0))
  465. assert_equal(Complex(Rational(1, 1073741827), Rational(1, 1073741827)),
  466. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) / Complex(1073741789, 0))
  467. assert_equal(Complex(Rational(1152921512123039718, 1073741827), Rational(1073741789, 1073741827)),
  468. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) + Complex(1073741827, 0))
  469. assert_equal(Complex(Rational(-1152921509975556140, 1073741827), Rational(1073741789, 1073741827)),
  470. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) - Complex(1073741827, 0))
  471. assert_equal(Complex(1073741789, 1073741789),
  472. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) * Complex(1073741827, 0))
  473. assert_equal(Complex(Rational(1073741789, 1152921511049297929), Rational(1073741789, 1152921511049297929)),
  474. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) / Complex(1073741827, 0))
  475. assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1152921471320850292, 1073741827)),
  476. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) + Complex(1073741789, 1073741789))
  477. assert_equal(Complex(Rational(-1152921469173366714, 1073741827), Rational(-1152921469173366714, 1073741827)),
  478. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) - Complex(1073741789, 1073741789))
  479. assert_equal(Complex(0, Rational(2305842858889841042, 1073741827)),
  480. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) * Complex(1073741789, 1073741789))
  481. assert_equal(Complex(Rational(1, 1073741827), 0),
  482. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) / Complex(1073741789, 1073741789))
  483. assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1152921512123039718, 1073741827)),
  484. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) + Complex(1073741789, 1073741827))
  485. assert_equal(Complex(Rational(-1152921469173366714, 1073741827), Rational(-1152921509975556140, 1073741827)),
  486. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) - Complex(1073741789, 1073741827))
  487. assert_equal(Complex(Rational(-40802187982, 1073741827), Rational(2305842899692029024, 1073741827)),
  488. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) * Complex(1073741789, 1073741827))
  489. assert_equal(Complex(Rational(1152921449846014512, 1237940005850657200720054075), Rational(-20401093991, 1237940005850657200720054075)),
  490. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) / Complex(1073741789, 1073741827))
  491. assert_equal(Complex(Rational(1152921512123039718, 1073741827), Rational(1152921512123039718, 1073741827)),
  492. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) + Complex(1073741827, 1073741827))
  493. assert_equal(Complex(Rational(-1152921509975556140, 1073741827), Rational(-1152921509975556140, 1073741827)),
  494. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) - Complex(1073741827, 1073741827))
  495. assert_equal(Complex(0, 2147483578),
  496. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) * Complex(1073741827, 1073741827))
  497. assert_equal(Complex(Rational(1073741789, 1152921511049297929), 0),
  498. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) / Complex(1073741827, 1073741827))
  499. assert_equal(Complex(Rational(2147483578, 1073741827), Rational(2147483578, 1073741827)),
  500. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) + Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  501. assert_equal(Complex(0, 0),
  502. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) - Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  503. assert_equal(Complex(0, Rational(2305842858889841042, 1152921511049297929)),
  504. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) * Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  505. assert_equal(Complex(1, 0),
  506. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) / Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  507. assert_equal(Complex(Rational(2305842940494218450, 1152921470247108503), Rational(2305842940494218450, 1152921470247108503)),
  508. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) + Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  509. assert_equal(Complex(Rational(-81604377408, 1152921470247108503), Rational(-81604377408, 1152921470247108503)),
  510. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) - Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  511. assert_equal(Complex(0, 2),
  512. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) * Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  513. assert_equal(Complex(Rational(1152921429444920521, 1152921511049297929), 0),
  514. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) / Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  515. assert_equal(Complex(Rational(2147483578, 1073741827), Rational(2305842940494218450, 1152921470247108503)),
  516. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) + Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  517. assert_equal(Complex(0, Rational(-81604377408, 1152921470247108503)),
  518. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) - Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  519. assert_equal(Complex(Rational(-81604377408, 1152921511049297929), Rational(2305842940494218450, 1152921511049297929)),
  520. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) * Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  521. assert_equal(Complex(Rational(1329227869515036572020512360130906225, 1329227916556757626754787505905300241), Rational(-47041717725097069072123994784, 1329227916556757626754787505905300241)),
  522. Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) / Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
  523. assert_equal(Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)), +Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  524. assert_equal(Complex(Rational(-1073741827, 1073741789), Rational(-1073741827, 1073741789)), -Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
  525. assert_equal(Complex(Rational(2147483616, 1073741789), Rational(1073741827, 1073741789)),
  526. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) + Complex(1, 0))
  527. assert_equal(Complex(Rational(38, 1073741789), Rational(1073741827, 1073741789)),
  528. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) - Complex(1, 0))
  529. assert_equal(Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)),
  530. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) * Complex(1, 0))
  531. assert_equal(Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)),
  532. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) / Complex(1, 0))
  533. assert_equal(Complex(Rational(1152921430518662348, 1073741789), Rational(1073741827, 1073741789)),
  534. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) + Complex(1073741789, 0))
  535. assert_equal(Complex(Rational(-1152921428371178694, 1073741789), Rational(1073741827, 1073741789)),
  536. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) - Complex(1073741789, 0))
  537. assert_equal(Complex(1073741827, 1073741827),
  538. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) * Complex(1073741789, 0))
  539. assert_equal(Complex(Rational(1073741827, 1152921429444920521), Rational(1073741827, 1152921429444920521)),
  540. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) / Complex(1073741789, 0))
  541. assert_equal(Complex(Rational(1152921471320850330, 1073741789), Rational(1073741827, 1073741789)),
  542. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) + Complex(1073741827, 0))
  543. assert_equal(Complex(Rational(-1152921469173366676, 1073741789), Rational(1073741827, 1073741789)),
  544. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) - Complex(1073741827, 0))
  545. assert_equal(Complex(Rational(1152921511049297929, 1073741789), Rational(1152921511049297929, 1073741789)),
  546. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) * Complex(1073741827, 0))
  547. assert_equal(Complex(Rational(1, 1073741789), Rational(1, 1073741789)),
  548. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) / Complex(1073741827, 0))
  549. assert_equal(Complex(Rational(1152921430518662348, 1073741789), Rational(1152921430518662348, 1073741789)),
  550. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) + Complex(1073741789, 1073741789))
  551. assert_equal(Complex(Rational(-1152921428371178694, 1073741789), Rational(-1152921428371178694, 1073741789)),
  552. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) - Complex(1073741789, 1073741789))
  553. assert_equal(Complex(0, 2147483654),
  554. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) * Complex(1073741789, 1073741789))
  555. assert_equal(Complex(Rational(1073741827, 1152921429444920521), 0),
  556. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) / Complex(1073741789, 1073741789))
  557. assert_equal(Complex(Rational(1152921430518662348, 1073741789), Rational(1152921471320850330, 1073741789)),
  558. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) + Complex(1073741789, 1073741827))
  559. assert_equal(Complex(Rational(-1152921428371178694, 1073741789), Rational(-1152921469173366676, 1073741789)),
  560. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) - Complex(1073741789, 1073741827))
  561. assert_equal(Complex(Rational(-40802189426, 1073741789), Rational(2305842981296406432, 1073741789)),
  562. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) * Complex(1073741789, 1073741827))
  563. assert_equal(Complex(Rational(1152921490648203216, 1237939962039641331329903525), Rational(-20401094713, 1237939962039641331329903525)),
  564. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) / Complex(1073741789, 1073741827))
  565. assert_equal(Complex(Rational(1152921471320850330, 1073741789), Rational(1152921471320850330, 1073741789)),
  566. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) + Complex(1073741827, 1073741827))
  567. assert_equal(Complex(Rational(-1152921469173366676, 1073741789), Rational(-1152921469173366676, 1073741789)),
  568. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) - Complex(1073741827, 1073741827))
  569. assert_equal(Complex(0, Rational(2305843022098595858, 1073741789)),
  570. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) * Complex(1073741827, 1073741827))
  571. assert_equal(Complex(Rational(1, 1073741789), 0),
  572. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) / Complex(1073741827, 1073741827))
  573. assert_equal(Complex(Rational(2305842940494218450, 1152921470247108503), Rational(2305842940494218450, 1152921470247108503)),
  574. Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) + Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
  575. assert_equal(Complex(Rational(81604377408, 1152921470247108503),