dqMultiply.decTest 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. ------------------------------------------------------------------------
  2. -- dqMultiply.decTest -- decQuad multiplication --
  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. -- This set of tests are for decQuads only; all arguments are
  22. -- representable in a decQuad
  23. extended: 1
  24. clamp: 1
  25. precision: 34
  26. maxExponent: 6144
  27. minExponent: -6143
  28. rounding: half_even
  29. -- sanity checks
  30. dqmul000 multiply 2 2 -> 4
  31. dqmul001 multiply 2 3 -> 6
  32. dqmul002 multiply 5 1 -> 5
  33. dqmul003 multiply 5 2 -> 10
  34. dqmul004 multiply 1.20 2 -> 2.40
  35. dqmul005 multiply 1.20 0 -> 0.00
  36. dqmul006 multiply 1.20 -2 -> -2.40
  37. dqmul007 multiply -1.20 2 -> -2.40
  38. dqmul008 multiply -1.20 0 -> -0.00
  39. dqmul009 multiply -1.20 -2 -> 2.40
  40. dqmul010 multiply 5.09 7.1 -> 36.139
  41. dqmul011 multiply 2.5 4 -> 10.0
  42. dqmul012 multiply 2.50 4 -> 10.00
  43. dqmul013 multiply 1.23456789 1.0000000000000000000000000000 -> 1.234567890000000000000000000000000 Rounded
  44. dqmul015 multiply 2.50 4 -> 10.00
  45. dqmul016 multiply 9.99999999999999999 9.99999999999999999 -> 99.99999999999999980000000000000000 Inexact Rounded
  46. dqmul017 multiply 9.99999999999999999 -9.99999999999999999 -> -99.99999999999999980000000000000000 Inexact Rounded
  47. dqmul018 multiply -9.99999999999999999 9.99999999999999999 -> -99.99999999999999980000000000000000 Inexact Rounded
  48. dqmul019 multiply -9.99999999999999999 -9.99999999999999999 -> 99.99999999999999980000000000000000 Inexact Rounded
  49. -- zeros, etc.
  50. dqmul021 multiply 0 0 -> 0
  51. dqmul022 multiply 0 -0 -> -0
  52. dqmul023 multiply -0 0 -> -0
  53. dqmul024 multiply -0 -0 -> 0
  54. dqmul025 multiply -0.0 -0.0 -> 0.00
  55. dqmul026 multiply -0.0 -0.0 -> 0.00
  56. dqmul027 multiply -0.0 -0.0 -> 0.00
  57. dqmul028 multiply -0.0 -0.0 -> 0.00
  58. dqmul030 multiply 5.00 1E-3 -> 0.00500
  59. dqmul031 multiply 00.00 0.000 -> 0.00000
  60. dqmul032 multiply 00.00 0E-3 -> 0.00000 -- rhs is 0
  61. dqmul033 multiply 0E-3 00.00 -> 0.00000 -- lhs is 0
  62. dqmul034 multiply -5.00 1E-3 -> -0.00500
  63. dqmul035 multiply -00.00 0.000 -> -0.00000
  64. dqmul036 multiply -00.00 0E-3 -> -0.00000 -- rhs is 0
  65. dqmul037 multiply -0E-3 00.00 -> -0.00000 -- lhs is 0
  66. dqmul038 multiply 5.00 -1E-3 -> -0.00500
  67. dqmul039 multiply 00.00 -0.000 -> -0.00000
  68. dqmul040 multiply 00.00 -0E-3 -> -0.00000 -- rhs is 0
  69. dqmul041 multiply 0E-3 -00.00 -> -0.00000 -- lhs is 0
  70. dqmul042 multiply -5.00 -1E-3 -> 0.00500
  71. dqmul043 multiply -00.00 -0.000 -> 0.00000
  72. dqmul044 multiply -00.00 -0E-3 -> 0.00000 -- rhs is 0
  73. dqmul045 multiply -0E-3 -00.00 -> 0.00000 -- lhs is 0
  74. -- examples from decarith
  75. dqmul050 multiply 1.20 3 -> 3.60
  76. dqmul051 multiply 7 3 -> 21
  77. dqmul052 multiply 0.9 0.8 -> 0.72
  78. dqmul053 multiply 0.9 -0 -> -0.0
  79. dqmul054 multiply 654321 654321 -> 428135971041
  80. dqmul060 multiply 123.45 1e7 -> 1.2345E+9
  81. dqmul061 multiply 123.45 1e8 -> 1.2345E+10
  82. dqmul062 multiply 123.45 1e+9 -> 1.2345E+11
  83. dqmul063 multiply 123.45 1e10 -> 1.2345E+12
  84. dqmul064 multiply 123.45 1e11 -> 1.2345E+13
  85. dqmul065 multiply 123.45 1e12 -> 1.2345E+14
  86. dqmul066 multiply 123.45 1e13 -> 1.2345E+15
  87. -- test some intermediate lengths
  88. -- 1234567890123456
  89. dqmul080 multiply 0.1 1230123456456789 -> 123012345645678.9
  90. dqmul084 multiply 0.1 1230123456456789 -> 123012345645678.9
  91. dqmul090 multiply 1230123456456789 0.1 -> 123012345645678.9
  92. dqmul094 multiply 1230123456456789 0.1 -> 123012345645678.9
  93. -- test some more edge cases and carries
  94. dqmul101 multiply 9 9 -> 81
  95. dqmul102 multiply 9 90 -> 810
  96. dqmul103 multiply 9 900 -> 8100
  97. dqmul104 multiply 9 9000 -> 81000
  98. dqmul105 multiply 9 90000 -> 810000
  99. dqmul106 multiply 9 900000 -> 8100000
  100. dqmul107 multiply 9 9000000 -> 81000000
  101. dqmul108 multiply 9 90000000 -> 810000000
  102. dqmul109 multiply 9 900000000 -> 8100000000
  103. dqmul110 multiply 9 9000000000 -> 81000000000
  104. dqmul111 multiply 9 90000000000 -> 810000000000
  105. dqmul112 multiply 9 900000000000 -> 8100000000000
  106. dqmul113 multiply 9 9000000000000 -> 81000000000000
  107. dqmul114 multiply 9 90000000000000 -> 810000000000000
  108. dqmul115 multiply 9 900000000000000 -> 8100000000000000
  109. --dqmul116 multiply 9 9000000000000000 -> 81000000000000000
  110. --dqmul117 multiply 9 90000000000000000 -> 810000000000000000
  111. --dqmul118 multiply 9 900000000000000000 -> 8100000000000000000
  112. --dqmul119 multiply 9 9000000000000000000 -> 81000000000000000000
  113. --dqmul120 multiply 9 90000000000000000000 -> 810000000000000000000
  114. --dqmul121 multiply 9 900000000000000000000 -> 8100000000000000000000
  115. --dqmul122 multiply 9 9000000000000000000000 -> 81000000000000000000000
  116. --dqmul123 multiply 9 90000000000000000000000 -> 810000000000000000000000
  117. -- test some more edge cases without carries
  118. dqmul131 multiply 3 3 -> 9
  119. dqmul132 multiply 3 30 -> 90
  120. dqmul133 multiply 3 300 -> 900
  121. dqmul134 multiply 3 3000 -> 9000
  122. dqmul135 multiply 3 30000 -> 90000
  123. dqmul136 multiply 3 300000 -> 900000
  124. dqmul137 multiply 3 3000000 -> 9000000
  125. dqmul138 multiply 3 30000000 -> 90000000
  126. dqmul139 multiply 3 300000000 -> 900000000
  127. dqmul140 multiply 3 3000000000 -> 9000000000
  128. dqmul141 multiply 3 30000000000 -> 90000000000
  129. dqmul142 multiply 3 300000000000 -> 900000000000
  130. dqmul143 multiply 3 3000000000000 -> 9000000000000
  131. dqmul144 multiply 3 30000000000000 -> 90000000000000
  132. dqmul145 multiply 3 300000000000000 -> 900000000000000
  133. dqmul146 multiply 3 3000000000000000 -> 9000000000000000
  134. dqmul147 multiply 3 30000000000000000 -> 90000000000000000
  135. dqmul148 multiply 3 300000000000000000 -> 900000000000000000
  136. dqmul149 multiply 3 3000000000000000000 -> 9000000000000000000
  137. dqmul150 multiply 3 30000000000000000000 -> 90000000000000000000
  138. dqmul151 multiply 3 300000000000000000000 -> 900000000000000000000
  139. dqmul152 multiply 3 3000000000000000000000 -> 9000000000000000000000
  140. dqmul153 multiply 3 30000000000000000000000 -> 90000000000000000000000
  141. dqmul263 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011933696719165119928296 Inexact Rounded
  142. -- test some edge cases with exact rounding
  143. dqmul301 multiply 900000000000000000 9 -> 8100000000000000000
  144. dqmul302 multiply 900000000000000000 90 -> 81000000000000000000
  145. dqmul303 multiply 900000000000000000 900 -> 810000000000000000000
  146. dqmul304 multiply 900000000000000000 9000 -> 8100000000000000000000
  147. dqmul305 multiply 900000000000000000 90000 -> 81000000000000000000000
  148. dqmul306 multiply 900000000000000000 900000 -> 810000000000000000000000
  149. dqmul307 multiply 900000000000000000 9000000 -> 8100000000000000000000000
  150. dqmul308 multiply 900000000000000000 90000000 -> 81000000000000000000000000
  151. dqmul309 multiply 900000000000000000 900000000 -> 810000000000000000000000000
  152. dqmul310 multiply 900000000000000000 9000000000 -> 8100000000000000000000000000
  153. dqmul311 multiply 900000000000000000 90000000000 -> 81000000000000000000000000000
  154. dqmul312 multiply 900000000000000000 900000000000 -> 810000000000000000000000000000
  155. dqmul313 multiply 900000000000000000 9000000000000 -> 8100000000000000000000000000000
  156. dqmul314 multiply 900000000000000000 90000000000000 -> 81000000000000000000000000000000
  157. dqmul315 multiply 900000000000000000 900000000000000 -> 810000000000000000000000000000000
  158. dqmul316 multiply 900000000000000000 9000000000000000 -> 8100000000000000000000000000000000
  159. dqmul317 multiply 9000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+34 Rounded
  160. dqmul318 multiply 90000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+35 Rounded
  161. dqmul319 multiply 900000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+36 Rounded
  162. dqmul320 multiply 9000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+37 Rounded
  163. dqmul321 multiply 90000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+38 Rounded
  164. dqmul322 multiply 900000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+39 Rounded
  165. dqmul323 multiply 9000000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+40 Rounded
  166. -- tryzeros cases
  167. dqmul504 multiply 0E-4260 1000E-4260 -> 0E-6176 Clamped
  168. dqmul505 multiply 100E+4260 0E+4260 -> 0E+6111 Clamped
  169. -- mixed with zeros
  170. dqmul541 multiply 0 -1 -> -0
  171. dqmul542 multiply -0 -1 -> 0
  172. dqmul543 multiply 0 1 -> 0
  173. dqmul544 multiply -0 1 -> -0
  174. dqmul545 multiply -1 0 -> -0
  175. dqmul546 multiply -1 -0 -> 0
  176. dqmul547 multiply 1 0 -> 0
  177. dqmul548 multiply 1 -0 -> -0
  178. dqmul551 multiply 0.0 -1 -> -0.0
  179. dqmul552 multiply -0.0 -1 -> 0.0
  180. dqmul553 multiply 0.0 1 -> 0.0
  181. dqmul554 multiply -0.0 1 -> -0.0
  182. dqmul555 multiply -1.0 0 -> -0.0
  183. dqmul556 multiply -1.0 -0 -> 0.0
  184. dqmul557 multiply 1.0 0 -> 0.0
  185. dqmul558 multiply 1.0 -0 -> -0.0
  186. dqmul561 multiply 0 -1.0 -> -0.0
  187. dqmul562 multiply -0 -1.0 -> 0.0
  188. dqmul563 multiply 0 1.0 -> 0.0
  189. dqmul564 multiply -0 1.0 -> -0.0
  190. dqmul565 multiply -1 0.0 -> -0.0
  191. dqmul566 multiply -1 -0.0 -> 0.0
  192. dqmul567 multiply 1 0.0 -> 0.0
  193. dqmul568 multiply 1 -0.0 -> -0.0
  194. dqmul571 multiply 0.0 -1.0 -> -0.00
  195. dqmul572 multiply -0.0 -1.0 -> 0.00
  196. dqmul573 multiply 0.0 1.0 -> 0.00
  197. dqmul574 multiply -0.0 1.0 -> -0.00
  198. dqmul575 multiply -1.0 0.0 -> -0.00
  199. dqmul576 multiply -1.0 -0.0 -> 0.00
  200. dqmul577 multiply 1.0 0.0 -> 0.00
  201. dqmul578 multiply 1.0 -0.0 -> -0.00
  202. -- Specials
  203. dqmul580 multiply Inf -Inf -> -Infinity
  204. dqmul581 multiply Inf -1000 -> -Infinity
  205. dqmul582 multiply Inf -1 -> -Infinity
  206. dqmul583 multiply Inf -0 -> NaN Invalid_operation
  207. dqmul584 multiply Inf 0 -> NaN Invalid_operation
  208. dqmul585 multiply Inf 1 -> Infinity
  209. dqmul586 multiply Inf 1000 -> Infinity
  210. dqmul587 multiply Inf Inf -> Infinity
  211. dqmul588 multiply -1000 Inf -> -Infinity
  212. dqmul589 multiply -Inf Inf -> -Infinity
  213. dqmul590 multiply -1 Inf -> -Infinity
  214. dqmul591 multiply -0 Inf -> NaN Invalid_operation
  215. dqmul592 multiply 0 Inf -> NaN Invalid_operation
  216. dqmul593 multiply 1 Inf -> Infinity
  217. dqmul594 multiply 1000 Inf -> Infinity
  218. dqmul595 multiply Inf Inf -> Infinity
  219. dqmul600 multiply -Inf -Inf -> Infinity
  220. dqmul601 multiply -Inf -1000 -> Infinity
  221. dqmul602 multiply -Inf -1 -> Infinity
  222. dqmul603 multiply -Inf -0 -> NaN Invalid_operation
  223. dqmul604 multiply -Inf 0 -> NaN Invalid_operation
  224. dqmul605 multiply -Inf 1 -> -Infinity
  225. dqmul606 multiply -Inf 1000 -> -Infinity
  226. dqmul607 multiply -Inf Inf -> -Infinity
  227. dqmul608 multiply -1000 Inf -> -Infinity
  228. dqmul609 multiply -Inf -Inf -> Infinity
  229. dqmul610 multiply -1 -Inf -> Infinity
  230. dqmul611 multiply -0 -Inf -> NaN Invalid_operation
  231. dqmul612 multiply 0 -Inf -> NaN Invalid_operation
  232. dqmul613 multiply 1 -Inf -> -Infinity
  233. dqmul614 multiply 1000 -Inf -> -Infinity
  234. dqmul615 multiply Inf -Inf -> -Infinity
  235. dqmul621 multiply NaN -Inf -> NaN
  236. dqmul622 multiply NaN -1000 -> NaN
  237. dqmul623 multiply NaN -1 -> NaN
  238. dqmul624 multiply NaN -0 -> NaN
  239. dqmul625 multiply NaN 0 -> NaN
  240. dqmul626 multiply NaN 1 -> NaN
  241. dqmul627 multiply NaN 1000 -> NaN
  242. dqmul628 multiply NaN Inf -> NaN
  243. dqmul629 multiply NaN NaN -> NaN
  244. dqmul630 multiply -Inf NaN -> NaN
  245. dqmul631 multiply -1000 NaN -> NaN
  246. dqmul632 multiply -1 NaN -> NaN
  247. dqmul633 multiply -0 NaN -> NaN
  248. dqmul634 multiply 0 NaN -> NaN
  249. dqmul635 multiply 1 NaN -> NaN
  250. dqmul636 multiply 1000 NaN -> NaN
  251. dqmul637 multiply Inf NaN -> NaN
  252. dqmul641 multiply sNaN -Inf -> NaN Invalid_operation
  253. dqmul642 multiply sNaN -1000 -> NaN Invalid_operation
  254. dqmul643 multiply sNaN -1 -> NaN Invalid_operation
  255. dqmul644 multiply sNaN -0 -> NaN Invalid_operation
  256. dqmul645 multiply sNaN 0 -> NaN Invalid_operation
  257. dqmul646 multiply sNaN 1 -> NaN Invalid_operation
  258. dqmul647 multiply sNaN 1000 -> NaN Invalid_operation
  259. dqmul648 multiply sNaN NaN -> NaN Invalid_operation
  260. dqmul649 multiply sNaN sNaN -> NaN Invalid_operation
  261. dqmul650 multiply NaN sNaN -> NaN Invalid_operation
  262. dqmul651 multiply -Inf sNaN -> NaN Invalid_operation
  263. dqmul652 multiply -1000 sNaN -> NaN Invalid_operation
  264. dqmul653 multiply -1 sNaN -> NaN Invalid_operation
  265. dqmul654 multiply -0 sNaN -> NaN Invalid_operation
  266. dqmul655 multiply 0 sNaN -> NaN Invalid_operation
  267. dqmul656 multiply 1 sNaN -> NaN Invalid_operation
  268. dqmul657 multiply 1000 sNaN -> NaN Invalid_operation
  269. dqmul658 multiply Inf sNaN -> NaN Invalid_operation
  270. dqmul659 multiply NaN sNaN -> NaN Invalid_operation
  271. -- propagating NaNs
  272. dqmul661 multiply NaN9 -Inf -> NaN9
  273. dqmul662 multiply NaN8 999 -> NaN8
  274. dqmul663 multiply NaN71 Inf -> NaN71
  275. dqmul664 multiply NaN6 NaN5 -> NaN6
  276. dqmul665 multiply -Inf NaN4 -> NaN4
  277. dqmul666 multiply -999 NaN33 -> NaN33
  278. dqmul667 multiply Inf NaN2 -> NaN2
  279. dqmul671 multiply sNaN99 -Inf -> NaN99 Invalid_operation
  280. dqmul672 multiply sNaN98 -11 -> NaN98 Invalid_operation
  281. dqmul673 multiply sNaN97 NaN -> NaN97 Invalid_operation
  282. dqmul674 multiply sNaN16 sNaN94 -> NaN16 Invalid_operation
  283. dqmul675 multiply NaN95 sNaN93 -> NaN93 Invalid_operation
  284. dqmul676 multiply -Inf sNaN92 -> NaN92 Invalid_operation
  285. dqmul677 multiply 088 sNaN91 -> NaN91 Invalid_operation
  286. dqmul678 multiply Inf sNaN90 -> NaN90 Invalid_operation
  287. dqmul679 multiply NaN sNaN89 -> NaN89 Invalid_operation
  288. dqmul681 multiply -NaN9 -Inf -> -NaN9
  289. dqmul682 multiply -NaN8 999 -> -NaN8
  290. dqmul683 multiply -NaN71 Inf -> -NaN71
  291. dqmul684 multiply -NaN6 -NaN5 -> -NaN6
  292. dqmul685 multiply -Inf -NaN4 -> -NaN4
  293. dqmul686 multiply -999 -NaN33 -> -NaN33
  294. dqmul687 multiply Inf -NaN2 -> -NaN2
  295. dqmul691 multiply -sNaN99 -Inf -> -NaN99 Invalid_operation
  296. dqmul692 multiply -sNaN98 -11 -> -NaN98 Invalid_operation
  297. dqmul693 multiply -sNaN97 NaN -> -NaN97 Invalid_operation
  298. dqmul694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation
  299. dqmul695 multiply -NaN95 -sNaN93 -> -NaN93 Invalid_operation
  300. dqmul696 multiply -Inf -sNaN92 -> -NaN92 Invalid_operation
  301. dqmul697 multiply 088 -sNaN91 -> -NaN91 Invalid_operation
  302. dqmul698 multiply Inf -sNaN90 -> -NaN90 Invalid_operation
  303. dqmul699 multiply -NaN -sNaN89 -> -NaN89 Invalid_operation
  304. dqmul701 multiply -NaN -Inf -> -NaN
  305. dqmul702 multiply -NaN 999 -> -NaN
  306. dqmul703 multiply -NaN Inf -> -NaN
  307. dqmul704 multiply -NaN -NaN -> -NaN
  308. dqmul705 multiply -Inf -NaN0 -> -NaN
  309. dqmul706 multiply -999 -NaN -> -NaN
  310. dqmul707 multiply Inf -NaN -> -NaN
  311. dqmul711 multiply -sNaN -Inf -> -NaN Invalid_operation
  312. dqmul712 multiply -sNaN -11 -> -NaN Invalid_operation
  313. dqmul713 multiply -sNaN00 NaN -> -NaN Invalid_operation
  314. dqmul714 multiply -sNaN -sNaN -> -NaN Invalid_operation
  315. dqmul715 multiply -NaN -sNaN -> -NaN Invalid_operation
  316. dqmul716 multiply -Inf -sNaN -> -NaN Invalid_operation
  317. dqmul717 multiply 088 -sNaN -> -NaN Invalid_operation
  318. dqmul718 multiply Inf -sNaN -> -NaN Invalid_operation
  319. dqmul719 multiply -NaN -sNaN -> -NaN Invalid_operation
  320. -- overflow and underflow tests .. note subnormal results
  321. -- signs
  322. dqmul751 multiply 1e+4277 1e+3311 -> Infinity Overflow Inexact Rounded
  323. dqmul752 multiply 1e+4277 -1e+3311 -> -Infinity Overflow Inexact Rounded
  324. dqmul753 multiply -1e+4277 1e+3311 -> -Infinity Overflow Inexact Rounded
  325. dqmul754 multiply -1e+4277 -1e+3311 -> Infinity Overflow Inexact Rounded
  326. dqmul755 multiply 1e-4277 1e-3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
  327. dqmul756 multiply 1e-4277 -1e-3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
  328. dqmul757 multiply -1e-4277 1e-3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
  329. dqmul758 multiply -1e-4277 -1e-3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
  330. -- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
  331. dqmul760 multiply 1e-6069 1e-101 -> 1E-6170 Subnormal
  332. dqmul761 multiply 1e-6069 1e-102 -> 1E-6171 Subnormal
  333. dqmul762 multiply 1e-6069 1e-103 -> 1E-6172 Subnormal
  334. dqmul763 multiply 1e-6069 1e-104 -> 1E-6173 Subnormal
  335. dqmul764 multiply 1e-6069 1e-105 -> 1E-6174 Subnormal
  336. dqmul765 multiply 1e-6069 1e-106 -> 1E-6175 Subnormal
  337. dqmul766 multiply 1e-6069 1e-107 -> 1E-6176 Subnormal
  338. dqmul767 multiply 1e-6069 1e-108 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
  339. dqmul768 multiply 1e-6069 1e-109 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
  340. dqmul769 multiply 1e-6069 1e-110 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
  341. -- [no equivalent of 'subnormal' for overflow]
  342. dqmul770 multiply 1e+40 1e+6101 -> 1.000000000000000000000000000000E+6141 Clamped
  343. dqmul771 multiply 1e+40 1e+6102 -> 1.0000000000000000000000000000000E+6142 Clamped
  344. dqmul772 multiply 1e+40 1e+6103 -> 1.00000000000000000000000000000000E+6143 Clamped
  345. dqmul773 multiply 1e+40 1e+6104 -> 1.000000000000000000000000000000000E+6144 Clamped
  346. dqmul774 multiply 1e+40 1e+6105 -> Infinity Overflow Inexact Rounded
  347. dqmul775 multiply 1e+40 1e+6106 -> Infinity Overflow Inexact Rounded
  348. dqmul776 multiply 1e+40 1e+6107 -> Infinity Overflow Inexact Rounded
  349. dqmul777 multiply 1e+40 1e+6108 -> Infinity Overflow Inexact Rounded
  350. dqmul778 multiply 1e+40 1e+6109 -> Infinity Overflow Inexact Rounded
  351. dqmul779 multiply 1e+40 1e+6110 -> Infinity Overflow Inexact Rounded
  352. dqmul801 multiply 1.0000E-6172 1 -> 1.0000E-6172 Subnormal
  353. dqmul802 multiply 1.000E-6172 1e-1 -> 1.000E-6173 Subnormal
  354. dqmul803 multiply 1.00E-6172 1e-2 -> 1.00E-6174 Subnormal
  355. dqmul804 multiply 1.0E-6172 1e-3 -> 1.0E-6175 Subnormal
  356. dqmul805 multiply 1.0E-6172 1e-4 -> 1E-6176 Subnormal Rounded
  357. dqmul806 multiply 1.3E-6172 1e-4 -> 1E-6176 Underflow Subnormal Inexact Rounded
  358. dqmul807 multiply 1.5E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
  359. dqmul808 multiply 1.7E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
  360. dqmul809 multiply 2.3E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
  361. dqmul810 multiply 2.5E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
  362. dqmul811 multiply 2.7E-6172 1e-4 -> 3E-6176 Underflow Subnormal Inexact Rounded
  363. dqmul812 multiply 1.49E-6172 1e-4 -> 1E-6176 Underflow Subnormal Inexact Rounded
  364. dqmul813 multiply 1.50E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
  365. dqmul814 multiply 1.51E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
  366. dqmul815 multiply 2.49E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
  367. dqmul816 multiply 2.50E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
  368. dqmul817 multiply 2.51E-6172 1e-4 -> 3E-6176 Underflow Subnormal Inexact Rounded
  369. dqmul818 multiply 1E-6172 1e-4 -> 1E-6176 Subnormal
  370. dqmul819 multiply 3E-6172 1e-5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
  371. dqmul820 multiply 5E-6172 1e-5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
  372. dqmul821 multiply 7E-6172 1e-5 -> 1E-6176 Underflow Subnormal Inexact Rounded
  373. dqmul822 multiply 9E-6172 1e-5 -> 1E-6176 Underflow Subnormal Inexact Rounded
  374. dqmul823 multiply 9.9E-6172 1e-5 -> 1E-6176 Underflow Subnormal Inexact Rounded
  375. dqmul824 multiply 1E-6172 -1e-4 -> -1E-6176 Subnormal
  376. dqmul825 multiply 3E-6172 -1e-5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
  377. dqmul826 multiply -5E-6172 1e-5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
  378. dqmul827 multiply 7E-6172 -1e-5 -> -1E-6176 Underflow Subnormal Inexact Rounded
  379. dqmul828 multiply -9E-6172 1e-5 -> -1E-6176 Underflow Subnormal Inexact Rounded
  380. dqmul829 multiply 9.9E-6172 -1e-5 -> -1E-6176 Underflow Subnormal Inexact Rounded
  381. dqmul830 multiply 3.0E-6172 -1e-5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
  382. dqmul831 multiply 1.0E-5977 1e-200 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
  383. dqmul832 multiply 1.0E-5977 1e-199 -> 1E-6176 Subnormal Rounded
  384. dqmul833 multiply 1.0E-5977 1e-198 -> 1.0E-6175 Subnormal
  385. dqmul834 multiply 2.0E-5977 2e-198 -> 4.0E-6175 Subnormal
  386. dqmul835 multiply 4.0E-5977 4e-198 -> 1.60E-6174 Subnormal
  387. dqmul836 multiply 10.0E-5977 10e-198 -> 1.000E-6173 Subnormal
  388. dqmul837 multiply 30.0E-5977 30e-198 -> 9.000E-6173 Subnormal
  389. dqmul838 multiply 40.0E-5982 40e-166 -> 1.6000E-6145 Subnormal
  390. dqmul839 multiply 40.0E-5982 40e-165 -> 1.6000E-6144 Subnormal
  391. dqmul840 multiply 40.0E-5982 40e-164 -> 1.6000E-6143
  392. -- Long operand overflow may be a different path
  393. dqmul870 multiply 100 9.999E+6143 -> Infinity Inexact Overflow Rounded
  394. dqmul871 multiply 100 -9.999E+6143 -> -Infinity Inexact Overflow Rounded
  395. dqmul872 multiply 9.999E+6143 100 -> Infinity Inexact Overflow Rounded
  396. dqmul873 multiply -9.999E+6143 100 -> -Infinity Inexact Overflow Rounded
  397. -- check for double-rounded subnormals
  398. dqmul881 multiply 1.2347E-6133 1.2347E-40 -> 1.524E-6173 Inexact Rounded Subnormal Underflow
  399. dqmul882 multiply 1.234E-6133 1.234E-40 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
  400. dqmul883 multiply 1.23E-6133 1.23E-40 -> 1.513E-6173 Inexact Rounded Subnormal Underflow
  401. dqmul884 multiply 1.2E-6133 1.2E-40 -> 1.44E-6173 Subnormal
  402. dqmul885 multiply 1.2E-6133 1.2E-41 -> 1.44E-6174 Subnormal
  403. dqmul886 multiply 1.2E-6133 1.2E-42 -> 1.4E-6175 Subnormal Inexact Rounded Underflow
  404. dqmul887 multiply 1.2E-6133 1.3E-42 -> 1.6E-6175 Subnormal Inexact Rounded Underflow
  405. dqmul888 multiply 1.3E-6133 1.3E-42 -> 1.7E-6175 Subnormal Inexact Rounded Underflow
  406. dqmul889 multiply 1.3E-6133 1.3E-43 -> 2E-6176 Subnormal Inexact Rounded Underflow
  407. dqmul890 multiply 1.3E-6134 1.3E-43 -> 0E-6176 Clamped Subnormal Inexact Rounded Underflow
  408. dqmul891 multiply 1.2345E-39 1.234E-6133 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow
  409. dqmul892 multiply 1.23456E-39 1.234E-6133 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow
  410. dqmul893 multiply 1.2345E-40 1.234E-6133 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
  411. dqmul894 multiply 1.23456E-40 1.234E-6133 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
  412. dqmul895 multiply 1.2345E-41 1.234E-6133 -> 1.52E-6174 Inexact Rounded Subnormal Underflow
  413. dqmul896 multiply 1.23456E-41 1.234E-6133 -> 1.52E-6174 Inexact Rounded Subnormal Underflow
  414. -- Now explore the case where we get a normal result with Underflow
  415. -- prove operands are exact
  416. dqmul906 multiply 9.999999999999999999999999999999999E-6143 1 -> 9.999999999999999999999999999999999E-6143
  417. dqmul907 multiply 1 0.09999999999999999999999999999999999 -> 0.09999999999999999999999999999999999
  418. -- the next rounds to Nmin
  419. dqmul908 multiply 9.999999999999999999999999999999999E-6143 0.09999999999999999999999999999999999 -> 1.000000000000000000000000000000000E-6143 Underflow Inexact Subnormal Rounded
  420. -- hugest
  421. dqmul909 multiply 9999999999999999999999999999999999 9999999999999999999999999999999999 -> 9.999999999999999999999999999999998E+67 Inexact Rounded
  422. -- VG case
  423. dqmul910 multiply 8.81125000000001349436E-1548 8.000000000000000000E-1550 -> 7.049000000000010795488000000000000E-3097 Rounded
  424. -- Examples from SQL proposal (Krishna Kulkarni)
  425. precision: 34
  426. rounding: half_up
  427. maxExponent: 6144
  428. minExponent: -6143
  429. dqmul911 multiply 130E-2 120E-2 -> 1.5600
  430. dqmul912 multiply 130E-2 12E-1 -> 1.560
  431. dqmul913 multiply 130E-2 1E0 -> 1.30
  432. dqmul914 multiply 1E2 1E4 -> 1E+6
  433. -- power-of-ten edge cases
  434. dqmul1001 multiply 1 10 -> 10
  435. dqmul1002 multiply 1 100 -> 100
  436. dqmul1003 multiply 1 1000 -> 1000
  437. dqmul1004 multiply 1 10000 -> 10000
  438. dqmul1005 multiply 1 100000 -> 100000
  439. dqmul1006 multiply 1 1000000 -> 1000000
  440. dqmul1007 multiply 1 10000000 -> 10000000
  441. dqmul1008 multiply 1 100000000 -> 100000000
  442. dqmul1009 multiply 1 1000000000 -> 1000000000
  443. dqmul1010 multiply 1 10000000000 -> 10000000000
  444. dqmul1011 multiply 1 100000000000 -> 100000000000
  445. dqmul1012 multiply 1 1000000000000 -> 1000000000000
  446. dqmul1013 multiply 1 10000000000000 -> 10000000000000
  447. dqmul1014 multiply 1 100000000000000 -> 100000000000000
  448. dqmul1015 multiply 1 1000000000000000 -> 1000000000000000
  449. dqmul1016 multiply 1 1000000000000000000 -> 1000000000000000000
  450. dqmul1017 multiply 1 100000000000000000000000000 -> 100000000000000000000000000
  451. dqmul1018 multiply 1 1000000000000000000000000000 -> 1000000000000000000000000000
  452. dqmul1019 multiply 1 10000000000000000000000000000 -> 10000000000000000000000000000
  453. dqmul1020 multiply 1 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
  454. dqmul1021 multiply 10 1 -> 10
  455. dqmul1022 multiply 10 10 -> 100
  456. dqmul1023 multiply 10 100 -> 1000
  457. dqmul1024 multiply 10 1000 -> 10000
  458. dqmul1025 multiply 10 10000 -> 100000
  459. dqmul1026 multiply 10 100000 -> 1000000
  460. dqmul1027 multiply 10 1000000 -> 10000000
  461. dqmul1028 multiply 10 10000000 -> 100000000
  462. dqmul1029 multiply 10 100000000 -> 1000000000
  463. dqmul1030 multiply 10 1000000000 -> 10000000000
  464. dqmul1031 multiply 10 10000000000 -> 100000000000
  465. dqmul1032 multiply 10 100000000000 -> 1000000000000
  466. dqmul1033 multiply 10 1000000000000 -> 10000000000000
  467. dqmul1034 multiply 10 10000000000000 -> 100000000000000
  468. dqmul1035 multiply 10 100000000000000 -> 1000000000000000
  469. dqmul1036 multiply 10 100000000000000000 -> 1000000000000000000
  470. dqmul1037 multiply 10 10000000000000000000000000 -> 100000000000000000000000000
  471. dqmul1038 multiply 10 100000000000000000000000000 -> 1000000000000000000000000000
  472. dqmul1039 multiply 10 1000000000000000000000000000 -> 10000000000000000000000000000
  473. dqmul1040 multiply 10 100000000000000000000000000000000 -> 1000000000000000000000000000000000
  474. dqmul1041 multiply 100 0.1 -> 10.0
  475. dqmul1042 multiply 100 1 -> 100
  476. dqmul1043 multiply 100 10 -> 1000
  477. dqmul1044 multiply 100 100 -> 10000
  478. dqmul1045 multiply 100 1000 -> 100000
  479. dqmul1046 multiply 100 10000 -> 1000000
  480. dqmul1047 multiply 100 100000 -> 10000000
  481. dqmul1048 multiply 100 1000000 -> 100000000
  482. dqmul1049 multiply 100 10000000 -> 1000000000
  483. dqmul1050 multiply 100 100000000 -> 10000000000
  484. dqmul1051 multiply 100 1000000000 -> 100000000000
  485. dqmul1052 multiply 100 10000000000 -> 1000000000000
  486. dqmul1053 multiply 100 100000000000 -> 10000000000000
  487. dqmul1054 multiply 100 1000000000000 -> 100000000000000
  488. dqmul1055 multiply 100 10000000000000 -> 1000000000000000
  489. dqmul1056 multiply 100 10000000000000000 -> 1000000000000000000
  490. dqmul1057 multiply 100 1000000000000000000000000 -> 100000000000000000000000000
  491. dqmul1058 multiply 100 10000000000000000000000000 -> 1000000000000000000000000000
  492. dqmul1059 multiply 100 100000000000000000000000000 -> 10000000000000000000000000000
  493. dqmul1060 multiply 100 10000000000000000000000000000000 -> 1000000000000000000000000000000000
  494. dqmul1061 multiply 1000 0.01 -> 10.00
  495. dqmul1062 multiply 1000 0.1 -> 100.0
  496. dqmul1063 multiply 1000 1 -> 1000
  497. dqmul1064 multiply 1000 10 -> 10000
  498. dqmul1065 multiply 1000 100 -> 100000
  499. dqmul1066 multiply 1000 1000 -> 1000000
  500. dqmul1067 multiply 1000 10000 -> 10000000
  501. dqmul1068 multiply 1000 100000 -> 100000000
  502. dqmul1069 multiply 1000 1000000 -> 1000000000
  503. dqmul1070 multiply 1000 10000000 -> 10000000000
  504. dqmul1071 multiply 1000 100000000 -> 100000000000
  505. dqmul1072 multiply 1000 1000000000 -> 1000000000000
  506. dqmul1073 multiply 1000 10000000000 -> 10000000000000
  507. dqmul1074 multiply 1000 100000000000 -> 100000000000000
  508. dqmul1075 multiply 1000 1000000000000 -> 1000000000000000
  509. dqmul1076 multiply 1000 1000000000000000 -> 1000000000000000000
  510. dqmul1077 multiply 1000 100000000000000000000000 -> 100000000000000000000000000
  511. dqmul1078 multiply 1000 1000000000000000000000000 -> 1000000000000000000000000000
  512. dqmul1079 multiply 1000 10000000000000000000000000 -> 10000000000000000000000000000
  513. dqmul1080 multiply 1000 1000000000000000000000000000000 -> 1000000000000000000000000000000000
  514. dqmul1081 multiply 10000 0.001 -> 10.000
  515. dqmul1082 multiply 10000 0.01 -> 100.00
  516. dqmul1083 multiply 10000 0.1 -> 1000.0
  517. dqmul1084 multiply 10000 1 -> 10000
  518. dqmul1085 multiply 10000 10 -> 100000
  519. dqmul1086 multiply 10000 100 -> 1000000
  520. dqmul1087 multiply 10000 1000 -> 10000000
  521. dqmul1088 multiply 10000 10000 -> 100000000
  522. dqmul1089 multiply 10000 100000 -> 1000000000
  523. dqmul1090 multiply 10000 1000000 -> 10000000000
  524. dqmul1091 multiply 10000 10000000 -> 100000000000
  525. dqmul1092 multiply 10000 100000000 -> 1000000000000
  526. dqmul1093 multiply 10000 1000000000 -> 10000000000000
  527. dqmul1094 multiply 10000 10000000000 -> 100000000000000
  528. dqmul1095 multiply 10000 100000000000 -> 1000000000000000
  529. dqmul1096 multiply 10000 100000000000000 -> 1000000000000000000
  530. dqmul1097 multiply 10000 10000000000000000000000 -> 100000000000000000000000000
  531. dqmul1098 multiply 10000 100000000000000000000000 -> 1000000000000000000000000000
  532. dqmul1099 multiply 10000 1000000000000000000000000 -> 10000000000000000000000000000
  533. dqmul1100 multiply 10000 100000000000000000000000000000 -> 1000000000000000000000000000000000
  534. dqmul1107 multiply 10000 99999999999 -> 999999999990000
  535. dqmul1108 multiply 10000 99999999999 -> 999999999990000
  536. -- Null tests
  537. dqmul9990 multiply 10 # -> NaN Invalid_operation
  538. dqmul9991 multiply # 10 -> NaN Invalid_operation