ddCompare.decTest 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744
  1. ------------------------------------------------------------------------
  2. -- ddCompare.decTest -- decDouble comparison that allows quiet NaNs --
  3. -- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
  4. ------------------------------------------------------------------------
  5. -- Please see the document "General Decimal Arithmetic Testcases" --
  6. -- at http://www2.hursley.ibm.com/decimal for the description of --
  7. -- these testcases. --
  8. -- --
  9. -- These testcases are experimental ('beta' versions), and they --
  10. -- may contain errors. They are offered on an as-is basis. In --
  11. -- particular, achieving the same results as the tests here is not --
  12. -- a guarantee that an implementation complies with any Standard --
  13. -- or specification. The tests are not exhaustive. --
  14. -- --
  15. -- Please send comments, suggestions, and corrections to the author: --
  16. -- Mike Cowlishaw, IBM Fellow --
  17. -- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
  18. -- mfc@uk.ibm.com --
  19. ------------------------------------------------------------------------
  20. version: 2.59
  21. -- Note that we cannot assume add/subtract tests cover paths adequately,
  22. -- here, because the code might be quite different (comparison cannot
  23. -- overflow or underflow, so actual subtractions are not necessary).
  24. -- All operands and results are decDoubles.
  25. precision: 16
  26. maxExponent: 384
  27. minExponent: -383
  28. extended: 1
  29. clamp: 1
  30. rounding: half_even
  31. -- sanity checks
  32. ddcom001 compare -2 -2 -> 0
  33. ddcom002 compare -2 -1 -> -1
  34. ddcom003 compare -2 0 -> -1
  35. ddcom004 compare -2 1 -> -1
  36. ddcom005 compare -2 2 -> -1
  37. ddcom006 compare -1 -2 -> 1
  38. ddcom007 compare -1 -1 -> 0
  39. ddcom008 compare -1 0 -> -1
  40. ddcom009 compare -1 1 -> -1
  41. ddcom010 compare -1 2 -> -1
  42. ddcom011 compare 0 -2 -> 1
  43. ddcom012 compare 0 -1 -> 1
  44. ddcom013 compare 0 0 -> 0
  45. ddcom014 compare 0 1 -> -1
  46. ddcom015 compare 0 2 -> -1
  47. ddcom016 compare 1 -2 -> 1
  48. ddcom017 compare 1 -1 -> 1
  49. ddcom018 compare 1 0 -> 1
  50. ddcom019 compare 1 1 -> 0
  51. ddcom020 compare 1 2 -> -1
  52. ddcom021 compare 2 -2 -> 1
  53. ddcom022 compare 2 -1 -> 1
  54. ddcom023 compare 2 0 -> 1
  55. ddcom025 compare 2 1 -> 1
  56. ddcom026 compare 2 2 -> 0
  57. ddcom031 compare -20 -20 -> 0
  58. ddcom032 compare -20 -10 -> -1
  59. ddcom033 compare -20 00 -> -1
  60. ddcom034 compare -20 10 -> -1
  61. ddcom035 compare -20 20 -> -1
  62. ddcom036 compare -10 -20 -> 1
  63. ddcom037 compare -10 -10 -> 0
  64. ddcom038 compare -10 00 -> -1
  65. ddcom039 compare -10 10 -> -1
  66. ddcom040 compare -10 20 -> -1
  67. ddcom041 compare 00 -20 -> 1
  68. ddcom042 compare 00 -10 -> 1
  69. ddcom043 compare 00 00 -> 0
  70. ddcom044 compare 00 10 -> -1
  71. ddcom045 compare 00 20 -> -1
  72. ddcom046 compare 10 -20 -> 1
  73. ddcom047 compare 10 -10 -> 1
  74. ddcom048 compare 10 00 -> 1
  75. ddcom049 compare 10 10 -> 0
  76. ddcom050 compare 10 20 -> -1
  77. ddcom051 compare 20 -20 -> 1
  78. ddcom052 compare 20 -10 -> 1
  79. ddcom053 compare 20 00 -> 1
  80. ddcom055 compare 20 10 -> 1
  81. ddcom056 compare 20 20 -> 0
  82. ddcom061 compare -2.0 -2.0 -> 0
  83. ddcom062 compare -2.0 -1.0 -> -1
  84. ddcom063 compare -2.0 0.0 -> -1
  85. ddcom064 compare -2.0 1.0 -> -1
  86. ddcom065 compare -2.0 2.0 -> -1
  87. ddcom066 compare -1.0 -2.0 -> 1
  88. ddcom067 compare -1.0 -1.0 -> 0
  89. ddcom068 compare -1.0 0.0 -> -1
  90. ddcom069 compare -1.0 1.0 -> -1
  91. ddcom070 compare -1.0 2.0 -> -1
  92. ddcom071 compare 0.0 -2.0 -> 1
  93. ddcom072 compare 0.0 -1.0 -> 1
  94. ddcom073 compare 0.0 0.0 -> 0
  95. ddcom074 compare 0.0 1.0 -> -1
  96. ddcom075 compare 0.0 2.0 -> -1
  97. ddcom076 compare 1.0 -2.0 -> 1
  98. ddcom077 compare 1.0 -1.0 -> 1
  99. ddcom078 compare 1.0 0.0 -> 1
  100. ddcom079 compare 1.0 1.0 -> 0
  101. ddcom080 compare 1.0 2.0 -> -1
  102. ddcom081 compare 2.0 -2.0 -> 1
  103. ddcom082 compare 2.0 -1.0 -> 1
  104. ddcom083 compare 2.0 0.0 -> 1
  105. ddcom085 compare 2.0 1.0 -> 1
  106. ddcom086 compare 2.0 2.0 -> 0
  107. ddcom087 compare 1.0 0.1 -> 1
  108. ddcom088 compare 0.1 1.0 -> -1
  109. -- now some cases which might overflow if subtract were used
  110. ddcom095 compare 9.999999999999999E+384 9.999999999999999E+384 -> 0
  111. ddcom096 compare -9.999999999999999E+384 9.999999999999999E+384 -> -1
  112. ddcom097 compare 9.999999999999999E+384 -9.999999999999999E+384 -> 1
  113. ddcom098 compare -9.999999999999999E+384 -9.999999999999999E+384 -> 0
  114. -- some differing length/exponent cases
  115. ddcom100 compare 7.0 7.0 -> 0
  116. ddcom101 compare 7.0 7 -> 0
  117. ddcom102 compare 7 7.0 -> 0
  118. ddcom103 compare 7E+0 7.0 -> 0
  119. ddcom104 compare 70E-1 7.0 -> 0
  120. ddcom105 compare 0.7E+1 7 -> 0
  121. ddcom106 compare 70E-1 7 -> 0
  122. ddcom107 compare 7.0 7E+0 -> 0
  123. ddcom108 compare 7.0 70E-1 -> 0
  124. ddcom109 compare 7 0.7E+1 -> 0
  125. ddcom110 compare 7 70E-1 -> 0
  126. ddcom120 compare 8.0 7.0 -> 1
  127. ddcom121 compare 8.0 7 -> 1
  128. ddcom122 compare 8 7.0 -> 1
  129. ddcom123 compare 8E+0 7.0 -> 1
  130. ddcom124 compare 80E-1 7.0 -> 1
  131. ddcom125 compare 0.8E+1 7 -> 1
  132. ddcom126 compare 80E-1 7 -> 1
  133. ddcom127 compare 8.0 7E+0 -> 1
  134. ddcom128 compare 8.0 70E-1 -> 1
  135. ddcom129 compare 8 0.7E+1 -> 1
  136. ddcom130 compare 8 70E-1 -> 1
  137. ddcom140 compare 8.0 9.0 -> -1
  138. ddcom141 compare 8.0 9 -> -1
  139. ddcom142 compare 8 9.0 -> -1
  140. ddcom143 compare 8E+0 9.0 -> -1
  141. ddcom144 compare 80E-1 9.0 -> -1
  142. ddcom145 compare 0.8E+1 9 -> -1
  143. ddcom146 compare 80E-1 9 -> -1
  144. ddcom147 compare 8.0 9E+0 -> -1
  145. ddcom148 compare 8.0 90E-1 -> -1
  146. ddcom149 compare 8 0.9E+1 -> -1
  147. ddcom150 compare 8 90E-1 -> -1
  148. -- and again, with sign changes -+ ..
  149. ddcom200 compare -7.0 7.0 -> -1
  150. ddcom201 compare -7.0 7 -> -1
  151. ddcom202 compare -7 7.0 -> -1
  152. ddcom203 compare -7E+0 7.0 -> -1
  153. ddcom204 compare -70E-1 7.0 -> -1
  154. ddcom205 compare -0.7E+1 7 -> -1
  155. ddcom206 compare -70E-1 7 -> -1
  156. ddcom207 compare -7.0 7E+0 -> -1
  157. ddcom208 compare -7.0 70E-1 -> -1
  158. ddcom209 compare -7 0.7E+1 -> -1
  159. ddcom210 compare -7 70E-1 -> -1
  160. ddcom220 compare -8.0 7.0 -> -1
  161. ddcom221 compare -8.0 7 -> -1
  162. ddcom222 compare -8 7.0 -> -1
  163. ddcom223 compare -8E+0 7.0 -> -1
  164. ddcom224 compare -80E-1 7.0 -> -1
  165. ddcom225 compare -0.8E+1 7 -> -1
  166. ddcom226 compare -80E-1 7 -> -1
  167. ddcom227 compare -8.0 7E+0 -> -1
  168. ddcom228 compare -8.0 70E-1 -> -1
  169. ddcom229 compare -8 0.7E+1 -> -1
  170. ddcom230 compare -8 70E-1 -> -1
  171. ddcom240 compare -8.0 9.0 -> -1
  172. ddcom241 compare -8.0 9 -> -1
  173. ddcom242 compare -8 9.0 -> -1
  174. ddcom243 compare -8E+0 9.0 -> -1
  175. ddcom244 compare -80E-1 9.0 -> -1
  176. ddcom245 compare -0.8E+1 9 -> -1
  177. ddcom246 compare -80E-1 9 -> -1
  178. ddcom247 compare -8.0 9E+0 -> -1
  179. ddcom248 compare -8.0 90E-1 -> -1
  180. ddcom249 compare -8 0.9E+1 -> -1
  181. ddcom250 compare -8 90E-1 -> -1
  182. -- and again, with sign changes +- ..
  183. ddcom300 compare 7.0 -7.0 -> 1
  184. ddcom301 compare 7.0 -7 -> 1
  185. ddcom302 compare 7 -7.0 -> 1
  186. ddcom303 compare 7E+0 -7.0 -> 1
  187. ddcom304 compare 70E-1 -7.0 -> 1
  188. ddcom305 compare .7E+1 -7 -> 1
  189. ddcom306 compare 70E-1 -7 -> 1
  190. ddcom307 compare 7.0 -7E+0 -> 1
  191. ddcom308 compare 7.0 -70E-1 -> 1
  192. ddcom309 compare 7 -.7E+1 -> 1
  193. ddcom310 compare 7 -70E-1 -> 1
  194. ddcom320 compare 8.0 -7.0 -> 1
  195. ddcom321 compare 8.0 -7 -> 1
  196. ddcom322 compare 8 -7.0 -> 1
  197. ddcom323 compare 8E+0 -7.0 -> 1
  198. ddcom324 compare 80E-1 -7.0 -> 1
  199. ddcom325 compare .8E+1 -7 -> 1
  200. ddcom326 compare 80E-1 -7 -> 1
  201. ddcom327 compare 8.0 -7E+0 -> 1
  202. ddcom328 compare 8.0 -70E-1 -> 1
  203. ddcom329 compare 8 -.7E+1 -> 1
  204. ddcom330 compare 8 -70E-1 -> 1
  205. ddcom340 compare 8.0 -9.0 -> 1
  206. ddcom341 compare 8.0 -9 -> 1
  207. ddcom342 compare 8 -9.0 -> 1
  208. ddcom343 compare 8E+0 -9.0 -> 1
  209. ddcom344 compare 80E-1 -9.0 -> 1
  210. ddcom345 compare .8E+1 -9 -> 1
  211. ddcom346 compare 80E-1 -9 -> 1
  212. ddcom347 compare 8.0 -9E+0 -> 1
  213. ddcom348 compare 8.0 -90E-1 -> 1
  214. ddcom349 compare 8 -.9E+1 -> 1
  215. ddcom350 compare 8 -90E-1 -> 1
  216. -- and again, with sign changes -- ..
  217. ddcom400 compare -7.0 -7.0 -> 0
  218. ddcom401 compare -7.0 -7 -> 0
  219. ddcom402 compare -7 -7.0 -> 0
  220. ddcom403 compare -7E+0 -7.0 -> 0
  221. ddcom404 compare -70E-1 -7.0 -> 0
  222. ddcom405 compare -.7E+1 -7 -> 0
  223. ddcom406 compare -70E-1 -7 -> 0
  224. ddcom407 compare -7.0 -7E+0 -> 0
  225. ddcom408 compare -7.0 -70E-1 -> 0
  226. ddcom409 compare -7 -.7E+1 -> 0
  227. ddcom410 compare -7 -70E-1 -> 0
  228. ddcom420 compare -8.0 -7.0 -> -1
  229. ddcom421 compare -8.0 -7 -> -1
  230. ddcom422 compare -8 -7.0 -> -1
  231. ddcom423 compare -8E+0 -7.0 -> -1
  232. ddcom424 compare -80E-1 -7.0 -> -1
  233. ddcom425 compare -.8E+1 -7 -> -1
  234. ddcom426 compare -80E-1 -7 -> -1
  235. ddcom427 compare -8.0 -7E+0 -> -1
  236. ddcom428 compare -8.0 -70E-1 -> -1
  237. ddcom429 compare -8 -.7E+1 -> -1
  238. ddcom430 compare -8 -70E-1 -> -1
  239. ddcom440 compare -8.0 -9.0 -> 1
  240. ddcom441 compare -8.0 -9 -> 1
  241. ddcom442 compare -8 -9.0 -> 1
  242. ddcom443 compare -8E+0 -9.0 -> 1
  243. ddcom444 compare -80E-1 -9.0 -> 1
  244. ddcom445 compare -.8E+1 -9 -> 1
  245. ddcom446 compare -80E-1 -9 -> 1
  246. ddcom447 compare -8.0 -9E+0 -> 1
  247. ddcom448 compare -8.0 -90E-1 -> 1
  248. ddcom449 compare -8 -.9E+1 -> 1
  249. ddcom450 compare -8 -90E-1 -> 1
  250. -- misalignment traps for little-endian
  251. ddcom451 compare 1.0 0.1 -> 1
  252. ddcom452 compare 0.1 1.0 -> -1
  253. ddcom453 compare 10.0 0.1 -> 1
  254. ddcom454 compare 0.1 10.0 -> -1
  255. ddcom455 compare 100 1.0 -> 1
  256. ddcom456 compare 1.0 100 -> -1
  257. ddcom457 compare 1000 10.0 -> 1
  258. ddcom458 compare 10.0 1000 -> -1
  259. ddcom459 compare 10000 100.0 -> 1
  260. ddcom460 compare 100.0 10000 -> -1
  261. ddcom461 compare 100000 1000.0 -> 1
  262. ddcom462 compare 1000.0 100000 -> -1
  263. ddcom463 compare 1000000 10000.0 -> 1
  264. ddcom464 compare 10000.0 1000000 -> -1
  265. -- testcases that subtract to lots of zeros at boundaries [pgr]
  266. ddcom473 compare 123.4560000000000E-89 123.456E-89 -> 0
  267. ddcom474 compare 123.456000000000E+89 123.456E+89 -> 0
  268. ddcom475 compare 123.45600000000E-89 123.456E-89 -> 0
  269. ddcom476 compare 123.4560000000E+89 123.456E+89 -> 0
  270. ddcom477 compare 123.456000000E-89 123.456E-89 -> 0
  271. ddcom478 compare 123.45600000E+89 123.456E+89 -> 0
  272. ddcom479 compare 123.4560000E-89 123.456E-89 -> 0
  273. ddcom480 compare 123.456000E+89 123.456E+89 -> 0
  274. ddcom481 compare 123.45600E-89 123.456E-89 -> 0
  275. ddcom482 compare 123.4560E+89 123.456E+89 -> 0
  276. ddcom483 compare 123.456E-89 123.456E-89 -> 0
  277. ddcom487 compare 123.456E+89 123.4560000000000E+89 -> 0
  278. ddcom488 compare 123.456E-89 123.456000000000E-89 -> 0
  279. ddcom489 compare 123.456E+89 123.45600000000E+89 -> 0
  280. ddcom490 compare 123.456E-89 123.4560000000E-89 -> 0
  281. ddcom491 compare 123.456E+89 123.456000000E+89 -> 0
  282. ddcom492 compare 123.456E-89 123.45600000E-89 -> 0
  283. ddcom493 compare 123.456E+89 123.4560000E+89 -> 0
  284. ddcom494 compare 123.456E-89 123.456000E-89 -> 0
  285. ddcom495 compare 123.456E+89 123.45600E+89 -> 0
  286. ddcom496 compare 123.456E-89 123.4560E-89 -> 0
  287. ddcom497 compare 123.456E+89 123.456E+89 -> 0
  288. -- wide-ranging, around precision; signs equal
  289. ddcom500 compare 1 1E-15 -> 1
  290. ddcom501 compare 1 1E-14 -> 1
  291. ddcom502 compare 1 1E-13 -> 1
  292. ddcom503 compare 1 1E-12 -> 1
  293. ddcom504 compare 1 1E-11 -> 1
  294. ddcom505 compare 1 1E-10 -> 1
  295. ddcom506 compare 1 1E-9 -> 1
  296. ddcom507 compare 1 1E-8 -> 1
  297. ddcom508 compare 1 1E-7 -> 1
  298. ddcom509 compare 1 1E-6 -> 1
  299. ddcom510 compare 1 1E-5 -> 1
  300. ddcom511 compare 1 1E-4 -> 1
  301. ddcom512 compare 1 1E-3 -> 1
  302. ddcom513 compare 1 1E-2 -> 1
  303. ddcom514 compare 1 1E-1 -> 1
  304. ddcom515 compare 1 1E-0 -> 0
  305. ddcom516 compare 1 1E+1 -> -1
  306. ddcom517 compare 1 1E+2 -> -1
  307. ddcom518 compare 1 1E+3 -> -1
  308. ddcom519 compare 1 1E+4 -> -1
  309. ddcom521 compare 1 1E+5 -> -1
  310. ddcom522 compare 1 1E+6 -> -1
  311. ddcom523 compare 1 1E+7 -> -1
  312. ddcom524 compare 1 1E+8 -> -1
  313. ddcom525 compare 1 1E+9 -> -1
  314. ddcom526 compare 1 1E+10 -> -1
  315. ddcom527 compare 1 1E+11 -> -1
  316. ddcom528 compare 1 1E+12 -> -1
  317. ddcom529 compare 1 1E+13 -> -1
  318. ddcom530 compare 1 1E+14 -> -1
  319. ddcom531 compare 1 1E+15 -> -1
  320. -- LR swap
  321. ddcom540 compare 1E-15 1 -> -1
  322. ddcom541 compare 1E-14 1 -> -1
  323. ddcom542 compare 1E-13 1 -> -1
  324. ddcom543 compare 1E-12 1 -> -1
  325. ddcom544 compare 1E-11 1 -> -1
  326. ddcom545 compare 1E-10 1 -> -1
  327. ddcom546 compare 1E-9 1 -> -1
  328. ddcom547 compare 1E-8 1 -> -1
  329. ddcom548 compare 1E-7 1 -> -1
  330. ddcom549 compare 1E-6 1 -> -1
  331. ddcom550 compare 1E-5 1 -> -1
  332. ddcom551 compare 1E-4 1 -> -1
  333. ddcom552 compare 1E-3 1 -> -1
  334. ddcom553 compare 1E-2 1 -> -1
  335. ddcom554 compare 1E-1 1 -> -1
  336. ddcom555 compare 1E-0 1 -> 0
  337. ddcom556 compare 1E+1 1 -> 1
  338. ddcom557 compare 1E+2 1 -> 1
  339. ddcom558 compare 1E+3 1 -> 1
  340. ddcom559 compare 1E+4 1 -> 1
  341. ddcom561 compare 1E+5 1 -> 1
  342. ddcom562 compare 1E+6 1 -> 1
  343. ddcom563 compare 1E+7 1 -> 1
  344. ddcom564 compare 1E+8 1 -> 1
  345. ddcom565 compare 1E+9 1 -> 1
  346. ddcom566 compare 1E+10 1 -> 1
  347. ddcom567 compare 1E+11 1 -> 1
  348. ddcom568 compare 1E+12 1 -> 1
  349. ddcom569 compare 1E+13 1 -> 1
  350. ddcom570 compare 1E+14 1 -> 1
  351. ddcom571 compare 1E+15 1 -> 1
  352. -- similar with a useful coefficient, one side only
  353. ddcom580 compare 0.000000987654321 1E-15 -> 1
  354. ddcom581 compare 0.000000987654321 1E-14 -> 1
  355. ddcom582 compare 0.000000987654321 1E-13 -> 1
  356. ddcom583 compare 0.000000987654321 1E-12 -> 1
  357. ddcom584 compare 0.000000987654321 1E-11 -> 1
  358. ddcom585 compare 0.000000987654321 1E-10 -> 1
  359. ddcom586 compare 0.000000987654321 1E-9 -> 1
  360. ddcom587 compare 0.000000987654321 1E-8 -> 1
  361. ddcom588 compare 0.000000987654321 1E-7 -> 1
  362. ddcom589 compare 0.000000987654321 1E-6 -> -1
  363. ddcom590 compare 0.000000987654321 1E-5 -> -1
  364. ddcom591 compare 0.000000987654321 1E-4 -> -1
  365. ddcom592 compare 0.000000987654321 1E-3 -> -1
  366. ddcom593 compare 0.000000987654321 1E-2 -> -1
  367. ddcom594 compare 0.000000987654321 1E-1 -> -1
  368. ddcom595 compare 0.000000987654321 1E-0 -> -1
  369. ddcom596 compare 0.000000987654321 1E+1 -> -1
  370. ddcom597 compare 0.000000987654321 1E+2 -> -1
  371. ddcom598 compare 0.000000987654321 1E+3 -> -1
  372. ddcom599 compare 0.000000987654321 1E+4 -> -1
  373. -- check some unit-y traps
  374. ddcom600 compare 12 12.2345 -> -1
  375. ddcom601 compare 12.0 12.2345 -> -1
  376. ddcom602 compare 12.00 12.2345 -> -1
  377. ddcom603 compare 12.000 12.2345 -> -1
  378. ddcom604 compare 12.0000 12.2345 -> -1
  379. ddcom605 compare 12.00000 12.2345 -> -1
  380. ddcom606 compare 12.000000 12.2345 -> -1
  381. ddcom607 compare 12.0000000 12.2345 -> -1
  382. ddcom608 compare 12.00000000 12.2345 -> -1
  383. ddcom609 compare 12.000000000 12.2345 -> -1
  384. ddcom610 compare 12.1234 12 -> 1
  385. ddcom611 compare 12.1234 12.0 -> 1
  386. ddcom612 compare 12.1234 12.00 -> 1
  387. ddcom613 compare 12.1234 12.000 -> 1
  388. ddcom614 compare 12.1234 12.0000 -> 1
  389. ddcom615 compare 12.1234 12.00000 -> 1
  390. ddcom616 compare 12.1234 12.000000 -> 1
  391. ddcom617 compare 12.1234 12.0000000 -> 1
  392. ddcom618 compare 12.1234 12.00000000 -> 1
  393. ddcom619 compare 12.1234 12.000000000 -> 1
  394. ddcom620 compare -12 -12.2345 -> 1
  395. ddcom621 compare -12.0 -12.2345 -> 1
  396. ddcom622 compare -12.00 -12.2345 -> 1
  397. ddcom623 compare -12.000 -12.2345 -> 1
  398. ddcom624 compare -12.0000 -12.2345 -> 1
  399. ddcom625 compare -12.00000 -12.2345 -> 1
  400. ddcom626 compare -12.000000 -12.2345 -> 1
  401. ddcom627 compare -12.0000000 -12.2345 -> 1
  402. ddcom628 compare -12.00000000 -12.2345 -> 1
  403. ddcom629 compare -12.000000000 -12.2345 -> 1
  404. ddcom630 compare -12.1234 -12 -> -1
  405. ddcom631 compare -12.1234 -12.0 -> -1
  406. ddcom632 compare -12.1234 -12.00 -> -1
  407. ddcom633 compare -12.1234 -12.000 -> -1
  408. ddcom634 compare -12.1234 -12.0000 -> -1
  409. ddcom635 compare -12.1234 -12.00000 -> -1
  410. ddcom636 compare -12.1234 -12.000000 -> -1
  411. ddcom637 compare -12.1234 -12.0000000 -> -1
  412. ddcom638 compare -12.1234 -12.00000000 -> -1
  413. ddcom639 compare -12.1234 -12.000000000 -> -1
  414. -- extended zeros
  415. ddcom640 compare 0 0 -> 0
  416. ddcom641 compare 0 -0 -> 0
  417. ddcom642 compare 0 -0.0 -> 0
  418. ddcom643 compare 0 0.0 -> 0
  419. ddcom644 compare -0 0 -> 0
  420. ddcom645 compare -0 -0 -> 0
  421. ddcom646 compare -0 -0.0 -> 0
  422. ddcom647 compare -0 0.0 -> 0
  423. ddcom648 compare 0.0 0 -> 0
  424. ddcom649 compare 0.0 -0 -> 0
  425. ddcom650 compare 0.0 -0.0 -> 0
  426. ddcom651 compare 0.0 0.0 -> 0
  427. ddcom652 compare -0.0 0 -> 0
  428. ddcom653 compare -0.0 -0 -> 0
  429. ddcom654 compare -0.0 -0.0 -> 0
  430. ddcom655 compare -0.0 0.0 -> 0
  431. ddcom656 compare -0E1 0.0 -> 0
  432. ddcom657 compare -0E2 0.0 -> 0
  433. ddcom658 compare 0E1 0.0 -> 0
  434. ddcom659 compare 0E2 0.0 -> 0
  435. ddcom660 compare -0E1 0 -> 0
  436. ddcom661 compare -0E2 0 -> 0
  437. ddcom662 compare 0E1 0 -> 0
  438. ddcom663 compare 0E2 0 -> 0
  439. ddcom664 compare -0E1 -0E1 -> 0
  440. ddcom665 compare -0E2 -0E1 -> 0
  441. ddcom666 compare 0E1 -0E1 -> 0
  442. ddcom667 compare 0E2 -0E1 -> 0
  443. ddcom668 compare -0E1 -0E2 -> 0
  444. ddcom669 compare -0E2 -0E2 -> 0
  445. ddcom670 compare 0E1 -0E2 -> 0
  446. ddcom671 compare 0E2 -0E2 -> 0
  447. ddcom672 compare -0E1 0E1 -> 0
  448. ddcom673 compare -0E2 0E1 -> 0
  449. ddcom674 compare 0E1 0E1 -> 0
  450. ddcom675 compare 0E2 0E1 -> 0
  451. ddcom676 compare -0E1 0E2 -> 0
  452. ddcom677 compare -0E2 0E2 -> 0
  453. ddcom678 compare 0E1 0E2 -> 0
  454. ddcom679 compare 0E2 0E2 -> 0
  455. -- trailing zeros; unit-y
  456. ddcom680 compare 12 12 -> 0
  457. ddcom681 compare 12 12.0 -> 0
  458. ddcom682 compare 12 12.00 -> 0
  459. ddcom683 compare 12 12.000 -> 0
  460. ddcom684 compare 12 12.0000 -> 0
  461. ddcom685 compare 12 12.00000 -> 0
  462. ddcom686 compare 12 12.000000 -> 0
  463. ddcom687 compare 12 12.0000000 -> 0
  464. ddcom688 compare 12 12.00000000 -> 0
  465. ddcom689 compare 12 12.000000000 -> 0
  466. ddcom690 compare 12 12 -> 0
  467. ddcom691 compare 12.0 12 -> 0
  468. ddcom692 compare 12.00 12 -> 0
  469. ddcom693 compare 12.000 12 -> 0
  470. ddcom694 compare 12.0000 12 -> 0
  471. ddcom695 compare 12.00000 12 -> 0
  472. ddcom696 compare 12.000000 12 -> 0
  473. ddcom697 compare 12.0000000 12 -> 0
  474. ddcom698 compare 12.00000000 12 -> 0
  475. ddcom699 compare 12.000000000 12 -> 0
  476. -- first, second, & last digit
  477. ddcom700 compare 1234567890123456 1234567890123455 -> 1
  478. ddcom701 compare 1234567890123456 1234567890123456 -> 0
  479. ddcom702 compare 1234567890123456 1234567890123457 -> -1
  480. ddcom703 compare 1234567890123456 0234567890123456 -> 1
  481. ddcom704 compare 1234567890123456 1234567890123456 -> 0
  482. ddcom705 compare 1234567890123456 2234567890123456 -> -1
  483. ddcom706 compare 1134567890123456 1034567890123456 -> 1
  484. ddcom707 compare 1134567890123456 1134567890123456 -> 0
  485. ddcom708 compare 1134567890123456 1234567890123456 -> -1
  486. -- miscellaneous
  487. ddcom721 compare 12345678000 1 -> 1
  488. ddcom722 compare 1 12345678000 -> -1
  489. ddcom723 compare 1234567800 1 -> 1
  490. ddcom724 compare 1 1234567800 -> -1
  491. ddcom725 compare 1234567890 1 -> 1
  492. ddcom726 compare 1 1234567890 -> -1
  493. ddcom727 compare 1234567891 1 -> 1
  494. ddcom728 compare 1 1234567891 -> -1
  495. ddcom729 compare 12345678901 1 -> 1
  496. ddcom730 compare 1 12345678901 -> -1
  497. ddcom731 compare 1234567896 1 -> 1
  498. ddcom732 compare 1 1234567896 -> -1
  499. -- residue cases at lower precision
  500. ddcom740 compare 1 0.9999999 -> 1
  501. ddcom741 compare 1 0.999999 -> 1
  502. ddcom742 compare 1 0.99999 -> 1
  503. ddcom743 compare 1 1.0000 -> 0
  504. ddcom744 compare 1 1.00001 -> -1
  505. ddcom745 compare 1 1.000001 -> -1
  506. ddcom746 compare 1 1.0000001 -> -1
  507. ddcom750 compare 0.9999999 1 -> -1
  508. ddcom751 compare 0.999999 1 -> -1
  509. ddcom752 compare 0.99999 1 -> -1
  510. ddcom753 compare 1.0000 1 -> 0
  511. ddcom754 compare 1.00001 1 -> 1
  512. ddcom755 compare 1.000001 1 -> 1
  513. ddcom756 compare 1.0000001 1 -> 1
  514. -- Specials
  515. ddcom780 compare Inf -Inf -> 1
  516. ddcom781 compare Inf -1000 -> 1
  517. ddcom782 compare Inf -1 -> 1
  518. ddcom783 compare Inf -0 -> 1
  519. ddcom784 compare Inf 0 -> 1
  520. ddcom785 compare Inf 1 -> 1
  521. ddcom786 compare Inf 1000 -> 1
  522. ddcom787 compare Inf Inf -> 0
  523. ddcom788 compare -1000 Inf -> -1
  524. ddcom789 compare -Inf Inf -> -1
  525. ddcom790 compare -1 Inf -> -1
  526. ddcom791 compare -0 Inf -> -1
  527. ddcom792 compare 0 Inf -> -1
  528. ddcom793 compare 1 Inf -> -1
  529. ddcom794 compare 1000 Inf -> -1
  530. ddcom795 compare Inf Inf -> 0
  531. ddcom800 compare -Inf -Inf -> 0
  532. ddcom801 compare -Inf -1000 -> -1
  533. ddcom802 compare -Inf -1 -> -1
  534. ddcom803 compare -Inf -0 -> -1
  535. ddcom804 compare -Inf 0 -> -1
  536. ddcom805 compare -Inf 1 -> -1
  537. ddcom806 compare -Inf 1000 -> -1
  538. ddcom807 compare -Inf Inf -> -1
  539. ddcom808 compare -Inf -Inf -> 0
  540. ddcom809 compare -1000 -Inf -> 1
  541. ddcom810 compare -1 -Inf -> 1
  542. ddcom811 compare -0 -Inf -> 1
  543. ddcom812 compare 0 -Inf -> 1
  544. ddcom813 compare 1 -Inf -> 1
  545. ddcom814 compare 1000 -Inf -> 1
  546. ddcom815 compare Inf -Inf -> 1
  547. ddcom821 compare NaN -Inf -> NaN
  548. ddcom822 compare NaN -1000 -> NaN
  549. ddcom823 compare NaN -1 -> NaN
  550. ddcom824 compare NaN -0 -> NaN
  551. ddcom825 compare NaN 0 -> NaN
  552. ddcom826 compare NaN 1 -> NaN
  553. ddcom827 compare NaN 1000 -> NaN
  554. ddcom828 compare NaN Inf -> NaN
  555. ddcom829 compare NaN NaN -> NaN
  556. ddcom830 compare -Inf NaN -> NaN
  557. ddcom831 compare -1000 NaN -> NaN
  558. ddcom832 compare -1 NaN -> NaN
  559. ddcom833 compare -0 NaN -> NaN
  560. ddcom834 compare 0 NaN -> NaN
  561. ddcom835 compare 1 NaN -> NaN
  562. ddcom836 compare 1000 NaN -> NaN
  563. ddcom837 compare Inf NaN -> NaN
  564. ddcom838 compare -NaN -NaN -> -NaN
  565. ddcom839 compare +NaN -NaN -> NaN
  566. ddcom840 compare -NaN +NaN -> -NaN
  567. ddcom841 compare sNaN -Inf -> NaN Invalid_operation
  568. ddcom842 compare sNaN -1000 -> NaN Invalid_operation
  569. ddcom843 compare sNaN -1 -> NaN Invalid_operation
  570. ddcom844 compare sNaN -0 -> NaN Invalid_operation
  571. ddcom845 compare sNaN 0 -> NaN Invalid_operation
  572. ddcom846 compare sNaN 1 -> NaN Invalid_operation
  573. ddcom847 compare sNaN 1000 -> NaN Invalid_operation
  574. ddcom848 compare sNaN NaN -> NaN Invalid_operation
  575. ddcom849 compare sNaN sNaN -> NaN Invalid_operation
  576. ddcom850 compare NaN sNaN -> NaN Invalid_operation
  577. ddcom851 compare -Inf sNaN -> NaN Invalid_operation
  578. ddcom852 compare -1000 sNaN -> NaN Invalid_operation
  579. ddcom853 compare -1 sNaN -> NaN Invalid_operation
  580. ddcom854 compare -0 sNaN -> NaN Invalid_operation
  581. ddcom855 compare 0 sNaN -> NaN Invalid_operation
  582. ddcom856 compare 1 sNaN -> NaN Invalid_operation
  583. ddcom857 compare 1000 sNaN -> NaN Invalid_operation
  584. ddcom858 compare Inf sNaN -> NaN Invalid_operation
  585. ddcom859 compare NaN sNaN -> NaN Invalid_operation
  586. -- propagating NaNs
  587. ddcom860 compare NaN9 -Inf -> NaN9
  588. ddcom861 compare NaN8 999 -> NaN8
  589. ddcom862 compare NaN77 Inf -> NaN77
  590. ddcom863 compare -NaN67 NaN5 -> -NaN67
  591. ddcom864 compare -Inf -NaN4 -> -NaN4
  592. ddcom865 compare -999 -NaN33 -> -NaN33
  593. ddcom866 compare Inf NaN2 -> NaN2
  594. ddcom867 compare -NaN41 -NaN42 -> -NaN41
  595. ddcom868 compare +NaN41 -NaN42 -> NaN41
  596. ddcom869 compare -NaN41 +NaN42 -> -NaN41
  597. ddcom870 compare +NaN41 +NaN42 -> NaN41
  598. ddcom871 compare -sNaN99 -Inf -> -NaN99 Invalid_operation
  599. ddcom872 compare sNaN98 -11 -> NaN98 Invalid_operation
  600. ddcom873 compare sNaN97 NaN -> NaN97 Invalid_operation
  601. ddcom874 compare sNaN16 sNaN94 -> NaN16 Invalid_operation
  602. ddcom875 compare NaN85 sNaN83 -> NaN83 Invalid_operation
  603. ddcom876 compare -Inf sNaN92 -> NaN92 Invalid_operation
  604. ddcom877 compare 088 sNaN81 -> NaN81 Invalid_operation
  605. ddcom878 compare Inf sNaN90 -> NaN90 Invalid_operation
  606. ddcom879 compare NaN -sNaN89 -> -NaN89 Invalid_operation
  607. -- wide range
  608. ddcom880 compare +1.23456789012345E-0 9E+384 -> -1
  609. ddcom881 compare 9E+384 +1.23456789012345E-0 -> 1
  610. ddcom882 compare +0.100 9E-383 -> 1
  611. ddcom883 compare 9E-383 +0.100 -> -1
  612. ddcom885 compare -1.23456789012345E-0 9E+384 -> -1
  613. ddcom886 compare 9E+384 -1.23456789012345E-0 -> 1
  614. ddcom887 compare -0.100 9E-383 -> -1
  615. ddcom888 compare 9E-383 -0.100 -> 1
  616. -- spread zeros
  617. ddcom900 compare 0E-383 0 -> 0
  618. ddcom901 compare 0E-383 -0 -> 0
  619. ddcom902 compare -0E-383 0 -> 0
  620. ddcom903 compare -0E-383 -0 -> 0
  621. ddcom904 compare 0E-383 0E+384 -> 0
  622. ddcom905 compare 0E-383 -0E+384 -> 0
  623. ddcom906 compare -0E-383 0E+384 -> 0
  624. ddcom907 compare -0E-383 -0E+384 -> 0
  625. ddcom908 compare 0 0E+384 -> 0
  626. ddcom909 compare 0 -0E+384 -> 0
  627. ddcom910 compare -0 0E+384 -> 0
  628. ddcom911 compare -0 -0E+384 -> 0
  629. ddcom930 compare 0E+384 0 -> 0
  630. ddcom931 compare 0E+384 -0 -> 0
  631. ddcom932 compare -0E+384 0 -> 0
  632. ddcom933 compare -0E+384 -0 -> 0
  633. ddcom934 compare 0E+384 0E-383 -> 0
  634. ddcom935 compare 0E+384 -0E-383 -> 0
  635. ddcom936 compare -0E+384 0E-383 -> 0
  636. ddcom937 compare -0E+384 -0E-383 -> 0
  637. ddcom938 compare 0 0E-383 -> 0
  638. ddcom939 compare 0 -0E-383 -> 0
  639. ddcom940 compare -0 0E-383 -> 0
  640. ddcom941 compare -0 -0E-383 -> 0
  641. -- signs
  642. ddcom961 compare 1e+77 1e+11 -> 1
  643. ddcom962 compare 1e+77 -1e+11 -> 1
  644. ddcom963 compare -1e+77 1e+11 -> -1
  645. ddcom964 compare -1e+77 -1e+11 -> -1
  646. ddcom965 compare 1e-77 1e-11 -> -1
  647. ddcom966 compare 1e-77 -1e-11 -> 1
  648. ddcom967 compare -1e-77 1e-11 -> -1
  649. ddcom968 compare -1e-77 -1e-11 -> 1
  650. -- full alignment range, both ways
  651. ddcomp1001 compare 1 1.000000000000000 -> 0
  652. ddcomp1002 compare 1 1.00000000000000 -> 0
  653. ddcomp1003 compare 1 1.0000000000000 -> 0
  654. ddcomp1004 compare 1 1.000000000000 -> 0
  655. ddcomp1005 compare 1 1.00000000000 -> 0
  656. ddcomp1006 compare 1 1.0000000000 -> 0
  657. ddcomp1007 compare 1 1.000000000 -> 0
  658. ddcomp1008 compare 1 1.00000000 -> 0
  659. ddcomp1009 compare 1 1.0000000 -> 0
  660. ddcomp1010 compare 1 1.000000 -> 0
  661. ddcomp1011 compare 1 1.00000 -> 0
  662. ddcomp1012 compare 1 1.0000 -> 0
  663. ddcomp1013 compare 1 1.000 -> 0
  664. ddcomp1014 compare 1 1.00 -> 0
  665. ddcomp1015 compare 1 1.0 -> 0
  666. ddcomp1021 compare 1.000000000000000 1 -> 0
  667. ddcomp1022 compare 1.00000000000000 1 -> 0
  668. ddcomp1023 compare 1.0000000000000 1 -> 0
  669. ddcomp1024 compare 1.000000000000 1 -> 0
  670. ddcomp1025 compare 1.00000000000 1 -> 0
  671. ddcomp1026 compare 1.0000000000 1 -> 0
  672. ddcomp1027 compare 1.000000000 1 -> 0
  673. ddcomp1028 compare 1.00000000 1 -> 0
  674. ddcomp1029 compare 1.0000000 1 -> 0
  675. ddcomp1030 compare 1.000000 1 -> 0
  676. ddcomp1031 compare 1.00000 1 -> 0
  677. ddcomp1032 compare 1.0000 1 -> 0
  678. ddcomp1033 compare 1.000 1 -> 0
  679. ddcomp1034 compare 1.00 1 -> 0
  680. ddcomp1035 compare 1.0 1 -> 0
  681. -- check MSD always detected non-zero
  682. ddcomp1040 compare 0 0.000000000000000 -> 0
  683. ddcomp1041 compare 0 1.000000000000000 -> -1
  684. ddcomp1042 compare 0 2.000000000000000 -> -1
  685. ddcomp1043 compare 0 3.000000000000000 -> -1
  686. ddcomp1044 compare 0 4.000000000000000 -> -1
  687. ddcomp1045 compare 0 5.000000000000000 -> -1
  688. ddcomp1046 compare 0 6.000000000000000 -> -1
  689. ddcomp1047 compare 0 7.000000000000000 -> -1
  690. ddcomp1048 compare 0 8.000000000000000 -> -1
  691. ddcomp1049 compare 0 9.000000000000000 -> -1
  692. ddcomp1050 compare 0.000000000000000 0 -> 0
  693. ddcomp1051 compare 1.000000000000000 0 -> 1
  694. ddcomp1052 compare 2.000000000000000 0 -> 1
  695. ddcomp1053 compare 3.000000000000000 0 -> 1
  696. ddcomp1054 compare 4.000000000000000 0 -> 1
  697. ddcomp1055 compare 5.000000000000000 0 -> 1
  698. ddcomp1056 compare 6.000000000000000 0 -> 1
  699. ddcomp1057 compare 7.000000000000000 0 -> 1
  700. ddcomp1058 compare 8.000000000000000 0 -> 1
  701. ddcomp1059 compare 9.000000000000000 0 -> 1
  702. -- Null tests
  703. ddcom9990 compare 10 # -> NaN Invalid_operation
  704. ddcom9991 compare # 10 -> NaN Invalid_operation