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