1------------------------------------------------------------------------
2-- ddSameQuantum.decTest -- check decDouble quantums match            --
3-- Copyright (c) IBM Corporation, 2001, 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-- All operands and results are decDoubles.
23precision:   16
24maxExponent: 384
25minExponent: -383
26extended:    1
27clamp:       1
28rounding:    half_even
29
30ddsamq001 samequantum  0      0      ->  1
31ddsamq002 samequantum  0      1      ->  1
32ddsamq003 samequantum  1      0      ->  1
33ddsamq004 samequantum  1      1      ->  1
34
35ddsamq011 samequantum  10     1E+1   -> 0
36ddsamq012 samequantum  10E+1  10E+1  -> 1
37ddsamq013 samequantum  100    10E+1  -> 0
38ddsamq014 samequantum  100    1E+2   -> 0
39ddsamq015 samequantum  0.1    1E-2   -> 0
40ddsamq016 samequantum  0.1    1E-1   -> 1
41ddsamq017 samequantum  0.1    1E-0   -> 0
42ddsamq018 samequantum  999    999    -> 1
43ddsamq019 samequantum  999E-1 99.9   -> 1
44ddsamq020 samequantum  111E-1 22.2   -> 1
45ddsamq021 samequantum  111E-1 1234.2 -> 1
46
47-- zeros
48ddsamq030 samequantum  0.0    1.1    -> 1
49ddsamq031 samequantum  0.0    1.11   -> 0
50ddsamq032 samequantum  0.0    0      -> 0
51ddsamq033 samequantum  0.0    0.0    -> 1
52ddsamq034 samequantum  0.0    0.00   -> 0
53ddsamq035 samequantum  0E+1   0E+0   -> 0
54ddsamq036 samequantum  0E+1   0E+1   -> 1
55ddsamq037 samequantum  0E+1   0E+2   -> 0
56ddsamq038 samequantum  0E-17  0E-16  -> 0
57ddsamq039 samequantum  0E-17  0E-17  -> 1
58ddsamq040 samequantum  0E-17  0E-18  -> 0
59ddsamq041 samequantum  0E-17  0.0E-15 -> 0
60ddsamq042 samequantum  0E-17  0.0E-16 -> 1
61ddsamq043 samequantum  0E-17  0.0E-17 -> 0
62ddsamq044 samequantum -0E-17  0.0E-16 -> 1
63ddsamq045 samequantum  0E-17 -0.0E-17 -> 0
64ddsamq046 samequantum  0E-17 -0.0E-16 -> 1
65ddsamq047 samequantum -0E-17  0.0E-17 -> 0
66ddsamq048 samequantum -0E-17 -0.0E-16 -> 1
67ddsamq049 samequantum -0E-17 -0.0E-17 -> 0
68
69-- Nmax, Nmin, Ntiny
70ddsamq051 samequantum  9.999999999999999E+384    9.999999999999999E+384  -> 1
71ddsamq052 samequantum  1E-383             1E-383           -> 1
72ddsamq053 samequantum  1.000000000000000E-383    1.000000000000000E-383  -> 1
73ddsamq054 samequantum  1E-398             1E-398           -> 1
74ddsamq055 samequantum  9.999999999999999E+384    9.999999999999999E+384  -> 1
75ddsamq056 samequantum  1E-383             1E-383           -> 1
76ddsamq057 samequantum  1.000000000000000E-383    1.000000000000000E-383  -> 1
77ddsamq058 samequantum  1E-398             1E-398           -> 1
78
79ddsamq061 samequantum  -1E-398            -1E-398          -> 1
80ddsamq062 samequantum  -1.000000000000000E-383   -1.000000000000000E-383 -> 1
81ddsamq063 samequantum  -1E-383            -1E-383          -> 1
82ddsamq064 samequantum  -9.999999999999999E+384   -9.999999999999999E+384 -> 1
83ddsamq065 samequantum  -1E-398            -1E-398          -> 1
84ddsamq066 samequantum  -1.000000000000000E-383   -1.000000000000000E-383 -> 1
85ddsamq067 samequantum  -1E-383            -1E-383          -> 1
86ddsamq068 samequantum  -9.999999999999999E+384   -9.999999999999999E+384 -> 1
87
88ddsamq071 samequantum  -4E-398            -1E-398          -> 1
89ddsamq072 samequantum  -4.000000000000000E-383   -1.000040000000000E-383 -> 1
90ddsamq073 samequantum  -4E-383            -1E-383          -> 1
91ddsamq074 samequantum  -4.999999999999999E+384   -9.999999999949999E+384 -> 1
92ddsamq075 samequantum  -4E-398            -1E-398          -> 1
93ddsamq076 samequantum  -4.000000000000000E-383   -1.004000000000000E-383 -> 1
94ddsamq077 samequantum  -4E-383            -1E-383          -> 1
95ddsamq078 samequantum  -4.999999999999999E+384   -9.949999999999999E+384 -> 1
96
97ddsamq081 samequantum  -4E-397            -1E-398          -> 0
98ddsamq082 samequantum  -4.000000000000000E-383   -1.000040000000000E-336 -> 0
99ddsamq083 samequantum  -4E-346            -1E-383          -> 0
100ddsamq084 samequantum  -4.999999999999999E+384   -9.999499999999999E+336 -> 0
101ddsamq085 samequantum  -4E-397            -1E-398          -> 0
102ddsamq086 samequantum  -4.000000000000000E-383   -1.004000000000000E-336 -> 0
103ddsamq087 samequantum  -4E-346            -1E-383          -> 0
104ddsamq088 samequantum  -4.999999999999999E+384   -9.949999999999999E+336 -> 0
105
106-- specials & combinations
107ddsamq0110 samequantum  -Inf    -Inf   -> 1
108ddsamq0111 samequantum  -Inf     Inf   -> 1
109ddsamq0112 samequantum  -Inf     NaN   -> 0
110ddsamq0113 samequantum  -Inf    -7E+3  -> 0
111ddsamq0114 samequantum  -Inf    -7     -> 0
112ddsamq0115 samequantum  -Inf    -7E-3  -> 0
113ddsamq0116 samequantum  -Inf    -0E-3  -> 0
114ddsamq0117 samequantum  -Inf    -0     -> 0
115ddsamq0118 samequantum  -Inf    -0E+3  -> 0
116ddsamq0119 samequantum  -Inf     0E-3  -> 0
117ddsamq0120 samequantum  -Inf     0     -> 0
118ddsamq0121 samequantum  -Inf     0E+3  -> 0
119ddsamq0122 samequantum  -Inf     7E-3  -> 0
120ddsamq0123 samequantum  -Inf     7     -> 0
121ddsamq0124 samequantum  -Inf     7E+3  -> 0
122ddsamq0125 samequantum  -Inf     sNaN  -> 0
123
124ddsamq0210 samequantum   Inf    -Inf   -> 1
125ddsamq0211 samequantum   Inf     Inf   -> 1
126ddsamq0212 samequantum   Inf     NaN   -> 0
127ddsamq0213 samequantum   Inf    -7E+3  -> 0
128ddsamq0214 samequantum   Inf    -7     -> 0
129ddsamq0215 samequantum   Inf    -7E-3  -> 0
130ddsamq0216 samequantum   Inf    -0E-3  -> 0
131ddsamq0217 samequantum   Inf    -0     -> 0
132ddsamq0218 samequantum   Inf    -0E+3  -> 0
133ddsamq0219 samequantum   Inf     0E-3  -> 0
134ddsamq0220 samequantum   Inf     0     -> 0
135ddsamq0221 samequantum   Inf     0E+3  -> 0
136ddsamq0222 samequantum   Inf     7E-3  -> 0
137ddsamq0223 samequantum   Inf     7     -> 0
138ddsamq0224 samequantum   Inf     7E+3  -> 0
139ddsamq0225 samequantum   Inf     sNaN  -> 0
140
141ddsamq0310 samequantum   NaN    -Inf   -> 0
142ddsamq0311 samequantum   NaN     Inf   -> 0
143ddsamq0312 samequantum   NaN     NaN   -> 1
144ddsamq0313 samequantum   NaN    -7E+3  -> 0
145ddsamq0314 samequantum   NaN    -7     -> 0
146ddsamq0315 samequantum   NaN    -7E-3  -> 0
147ddsamq0316 samequantum   NaN    -0E-3  -> 0
148ddsamq0317 samequantum   NaN    -0     -> 0
149ddsamq0318 samequantum   NaN    -0E+3  -> 0
150ddsamq0319 samequantum   NaN     0E-3  -> 0
151ddsamq0320 samequantum   NaN     0     -> 0
152ddsamq0321 samequantum   NaN     0E+3  -> 0
153ddsamq0322 samequantum   NaN     7E-3  -> 0
154ddsamq0323 samequantum   NaN     7     -> 0
155ddsamq0324 samequantum   NaN     7E+3  -> 0
156ddsamq0325 samequantum   NaN     sNaN  -> 1
157
158ddsamq0410 samequantum  -7E+3    -Inf   -> 0
159ddsamq0411 samequantum  -7E+3     Inf   -> 0
160ddsamq0412 samequantum  -7E+3     NaN   -> 0
161ddsamq0413 samequantum  -7E+3    -7E+3  -> 1
162ddsamq0414 samequantum  -7E+3    -7     -> 0
163ddsamq0415 samequantum  -7E+3    -7E-3  -> 0
164ddsamq0416 samequantum  -7E+3    -0E-3  -> 0
165ddsamq0417 samequantum  -7E+3    -0     -> 0
166ddsamq0418 samequantum  -7E+3    -0E+3  -> 1
167ddsamq0419 samequantum  -7E+3     0E-3  -> 0
168ddsamq0420 samequantum  -7E+3     0     -> 0
169ddsamq0421 samequantum  -7E+3     0E+3  -> 1
170ddsamq0422 samequantum  -7E+3     7E-3  -> 0
171ddsamq0423 samequantum  -7E+3     7     -> 0
172ddsamq0424 samequantum  -7E+3     7E+3  -> 1
173ddsamq0425 samequantum  -7E+3     sNaN  -> 0
174
175ddsamq0510 samequantum  -7      -Inf   -> 0
176ddsamq0511 samequantum  -7       Inf   -> 0
177ddsamq0512 samequantum  -7       NaN   -> 0
178ddsamq0513 samequantum  -7      -7E+3  -> 0
179ddsamq0514 samequantum  -7      -7     -> 1
180ddsamq0515 samequantum  -7      -7E-3  -> 0
181ddsamq0516 samequantum  -7      -0E-3  -> 0
182ddsamq0517 samequantum  -7      -0     -> 1
183ddsamq0518 samequantum  -7      -0E+3  -> 0
184ddsamq0519 samequantum  -7       0E-3  -> 0
185ddsamq0520 samequantum  -7       0     -> 1
186ddsamq0521 samequantum  -7       0E+3  -> 0
187ddsamq0522 samequantum  -7       7E-3  -> 0
188ddsamq0523 samequantum  -7       7     -> 1
189ddsamq0524 samequantum  -7       7E+3  -> 0
190ddsamq0525 samequantum  -7       sNaN  -> 0
191
192ddsamq0610 samequantum  -7E-3    -Inf   -> 0
193ddsamq0611 samequantum  -7E-3     Inf   -> 0
194ddsamq0612 samequantum  -7E-3     NaN   -> 0
195ddsamq0613 samequantum  -7E-3    -7E+3  -> 0
196ddsamq0614 samequantum  -7E-3    -7     -> 0
197ddsamq0615 samequantum  -7E-3    -7E-3  -> 1
198ddsamq0616 samequantum  -7E-3    -0E-3  -> 1
199ddsamq0617 samequantum  -7E-3    -0     -> 0
200ddsamq0618 samequantum  -7E-3    -0E+3  -> 0
201ddsamq0619 samequantum  -7E-3     0E-3  -> 1
202ddsamq0620 samequantum  -7E-3     0     -> 0
203ddsamq0621 samequantum  -7E-3     0E+3  -> 0
204ddsamq0622 samequantum  -7E-3     7E-3  -> 1
205ddsamq0623 samequantum  -7E-3     7     -> 0
206ddsamq0624 samequantum  -7E-3     7E+3  -> 0
207ddsamq0625 samequantum  -7E-3     sNaN  -> 0
208
209ddsamq0710 samequantum  -0E-3    -Inf   -> 0
210ddsamq0711 samequantum  -0E-3     Inf   -> 0
211ddsamq0712 samequantum  -0E-3     NaN   -> 0
212ddsamq0713 samequantum  -0E-3    -7E+3  -> 0
213ddsamq0714 samequantum  -0E-3    -7     -> 0
214ddsamq0715 samequantum  -0E-3    -7E-3  -> 1
215ddsamq0716 samequantum  -0E-3    -0E-3  -> 1
216ddsamq0717 samequantum  -0E-3    -0     -> 0
217ddsamq0718 samequantum  -0E-3    -0E+3  -> 0
218ddsamq0719 samequantum  -0E-3     0E-3  -> 1
219ddsamq0720 samequantum  -0E-3     0     -> 0
220ddsamq0721 samequantum  -0E-3     0E+3  -> 0
221ddsamq0722 samequantum  -0E-3     7E-3  -> 1
222ddsamq0723 samequantum  -0E-3     7     -> 0
223ddsamq0724 samequantum  -0E-3     7E+3  -> 0
224ddsamq0725 samequantum  -0E-3     sNaN  -> 0
225
226ddsamq0810 samequantum  -0      -Inf   -> 0
227ddsamq0811 samequantum  -0       Inf   -> 0
228ddsamq0812 samequantum  -0       NaN   -> 0
229ddsamq0813 samequantum  -0      -7E+3  -> 0
230ddsamq0814 samequantum  -0      -7     -> 1
231ddsamq0815 samequantum  -0      -7E-3  -> 0
232ddsamq0816 samequantum  -0      -0E-3  -> 0
233ddsamq0817 samequantum  -0      -0     -> 1
234ddsamq0818 samequantum  -0      -0E+3  -> 0
235ddsamq0819 samequantum  -0       0E-3  -> 0
236ddsamq0820 samequantum  -0       0     -> 1
237ddsamq0821 samequantum  -0       0E+3  -> 0
238ddsamq0822 samequantum  -0       7E-3  -> 0
239ddsamq0823 samequantum  -0       7     -> 1
240ddsamq0824 samequantum  -0       7E+3  -> 0
241ddsamq0825 samequantum  -0       sNaN  -> 0
242
243ddsamq0910 samequantum  -0E+3    -Inf   -> 0
244ddsamq0911 samequantum  -0E+3     Inf   -> 0
245ddsamq0912 samequantum  -0E+3     NaN   -> 0
246ddsamq0913 samequantum  -0E+3    -7E+3  -> 1
247ddsamq0914 samequantum  -0E+3    -7     -> 0
248ddsamq0915 samequantum  -0E+3    -7E-3  -> 0
249ddsamq0916 samequantum  -0E+3    -0E-3  -> 0
250ddsamq0917 samequantum  -0E+3    -0     -> 0
251ddsamq0918 samequantum  -0E+3    -0E+3  -> 1
252ddsamq0919 samequantum  -0E+3     0E-3  -> 0
253ddsamq0920 samequantum  -0E+3     0     -> 0
254ddsamq0921 samequantum  -0E+3     0E+3  -> 1
255ddsamq0922 samequantum  -0E+3     7E-3  -> 0
256ddsamq0923 samequantum  -0E+3     7     -> 0
257ddsamq0924 samequantum  -0E+3     7E+3  -> 1
258ddsamq0925 samequantum  -0E+3     sNaN  -> 0
259
260ddsamq1110 samequantum  0E-3    -Inf   -> 0
261ddsamq1111 samequantum  0E-3     Inf   -> 0
262ddsamq1112 samequantum  0E-3     NaN   -> 0
263ddsamq1113 samequantum  0E-3    -7E+3  -> 0
264ddsamq1114 samequantum  0E-3    -7     -> 0
265ddsamq1115 samequantum  0E-3    -7E-3  -> 1
266ddsamq1116 samequantum  0E-3    -0E-3  -> 1
267ddsamq1117 samequantum  0E-3    -0     -> 0
268ddsamq1118 samequantum  0E-3    -0E+3  -> 0
269ddsamq1119 samequantum  0E-3     0E-3  -> 1
270ddsamq1120 samequantum  0E-3     0     -> 0
271ddsamq1121 samequantum  0E-3     0E+3  -> 0
272ddsamq1122 samequantum  0E-3     7E-3  -> 1
273ddsamq1123 samequantum  0E-3     7     -> 0
274ddsamq1124 samequantum  0E-3     7E+3  -> 0
275ddsamq1125 samequantum  0E-3     sNaN  -> 0
276
277ddsamq1210 samequantum  0       -Inf   -> 0
278ddsamq1211 samequantum  0        Inf   -> 0
279ddsamq1212 samequantum  0        NaN   -> 0
280ddsamq1213 samequantum  0       -7E+3  -> 0
281ddsamq1214 samequantum  0       -7     -> 1
282ddsamq1215 samequantum  0       -7E-3  -> 0
283ddsamq1216 samequantum  0       -0E-3  -> 0
284ddsamq1217 samequantum  0       -0     -> 1
285ddsamq1218 samequantum  0       -0E+3  -> 0
286ddsamq1219 samequantum  0        0E-3  -> 0
287ddsamq1220 samequantum  0        0     -> 1
288ddsamq1221 samequantum  0        0E+3  -> 0
289ddsamq1222 samequantum  0        7E-3  -> 0
290ddsamq1223 samequantum  0        7     -> 1
291ddsamq1224 samequantum  0        7E+3  -> 0
292ddsamq1225 samequantum  0        sNaN  -> 0
293
294ddsamq1310 samequantum  0E+3    -Inf   -> 0
295ddsamq1311 samequantum  0E+3     Inf   -> 0
296ddsamq1312 samequantum  0E+3     NaN   -> 0
297ddsamq1313 samequantum  0E+3    -7E+3  -> 1
298ddsamq1314 samequantum  0E+3    -7     -> 0
299ddsamq1315 samequantum  0E+3    -7E-3  -> 0
300ddsamq1316 samequantum  0E+3    -0E-3  -> 0
301ddsamq1317 samequantum  0E+3    -0     -> 0
302ddsamq1318 samequantum  0E+3    -0E+3  -> 1
303ddsamq1319 samequantum  0E+3     0E-3  -> 0
304ddsamq1320 samequantum  0E+3     0     -> 0
305ddsamq1321 samequantum  0E+3     0E+3  -> 1
306ddsamq1322 samequantum  0E+3     7E-3  -> 0
307ddsamq1323 samequantum  0E+3     7     -> 0
308ddsamq1324 samequantum  0E+3     7E+3  -> 1
309ddsamq1325 samequantum  0E+3     sNaN  -> 0
310
311ddsamq1410 samequantum  7E-3    -Inf   -> 0
312ddsamq1411 samequantum  7E-3     Inf   -> 0
313ddsamq1412 samequantum  7E-3     NaN   -> 0
314ddsamq1413 samequantum  7E-3    -7E+3  -> 0
315ddsamq1414 samequantum  7E-3    -7     -> 0
316ddsamq1415 samequantum  7E-3    -7E-3  -> 1
317ddsamq1416 samequantum  7E-3    -0E-3  -> 1
318ddsamq1417 samequantum  7E-3    -0     -> 0
319ddsamq1418 samequantum  7E-3    -0E+3  -> 0
320ddsamq1419 samequantum  7E-3     0E-3  -> 1
321ddsamq1420 samequantum  7E-3     0     -> 0
322ddsamq1421 samequantum  7E-3     0E+3  -> 0
323ddsamq1422 samequantum  7E-3     7E-3  -> 1
324ddsamq1423 samequantum  7E-3     7     -> 0
325ddsamq1424 samequantum  7E-3     7E+3  -> 0
326ddsamq1425 samequantum  7E-3     sNaN  -> 0
327
328ddsamq1510 samequantum  7      -Inf   -> 0
329ddsamq1511 samequantum  7       Inf   -> 0
330ddsamq1512 samequantum  7       NaN   -> 0
331ddsamq1513 samequantum  7      -7E+3  -> 0
332ddsamq1514 samequantum  7      -7     -> 1
333ddsamq1515 samequantum  7      -7E-3  -> 0
334ddsamq1516 samequantum  7      -0E-3  -> 0
335ddsamq1517 samequantum  7      -0     -> 1
336ddsamq1518 samequantum  7      -0E+3  -> 0
337ddsamq1519 samequantum  7       0E-3  -> 0
338ddsamq1520 samequantum  7       0     -> 1
339ddsamq1521 samequantum  7       0E+3  -> 0
340ddsamq1522 samequantum  7       7E-3  -> 0
341ddsamq1523 samequantum  7       7     -> 1
342ddsamq1524 samequantum  7       7E+3  -> 0
343ddsamq1525 samequantum  7       sNaN  -> 0
344
345ddsamq1610 samequantum  7E+3    -Inf   -> 0
346ddsamq1611 samequantum  7E+3     Inf   -> 0
347ddsamq1612 samequantum  7E+3     NaN   -> 0
348ddsamq1613 samequantum  7E+3    -7E+3  -> 1
349ddsamq1614 samequantum  7E+3    -7     -> 0
350ddsamq1615 samequantum  7E+3    -7E-3  -> 0
351ddsamq1616 samequantum  7E+3    -0E-3  -> 0
352ddsamq1617 samequantum  7E+3    -0     -> 0
353ddsamq1618 samequantum  7E+3    -0E+3  -> 1
354ddsamq1619 samequantum  7E+3     0E-3  -> 0
355ddsamq1620 samequantum  7E+3     0     -> 0
356ddsamq1621 samequantum  7E+3     0E+3  -> 1
357ddsamq1622 samequantum  7E+3     7E-3  -> 0
358ddsamq1623 samequantum  7E+3     7     -> 0
359ddsamq1624 samequantum  7E+3     7E+3  -> 1
360ddsamq1625 samequantum  7E+3     sNaN  -> 0
361
362ddsamq1710 samequantum  sNaN    -Inf   -> 0
363ddsamq1711 samequantum  sNaN     Inf   -> 0
364ddsamq1712 samequantum  sNaN     NaN   -> 1
365ddsamq1713 samequantum  sNaN    -7E+3  -> 0
366ddsamq1714 samequantum  sNaN    -7     -> 0
367ddsamq1715 samequantum  sNaN    -7E-3  -> 0
368ddsamq1716 samequantum  sNaN    -0E-3  -> 0
369ddsamq1717 samequantum  sNaN    -0     -> 0
370ddsamq1718 samequantum  sNaN    -0E+3  -> 0
371ddsamq1719 samequantum  sNaN     0E-3  -> 0
372ddsamq1720 samequantum  sNaN     0     -> 0
373ddsamq1721 samequantum  sNaN     0E+3  -> 0
374ddsamq1722 samequantum  sNaN     7E-3  -> 0
375ddsamq1723 samequantum  sNaN     7     -> 0
376ddsamq1724 samequantum  sNaN     7E+3  -> 0
377ddsamq1725 samequantum  sNaN     sNaN  -> 1
378-- noisy NaNs
379ddsamq1730 samequantum  sNaN3    sNaN3 -> 1
380ddsamq1731 samequantum  sNaN3    sNaN4 -> 1
381ddsamq1732 samequantum   NaN3     NaN3 -> 1
382ddsamq1733 samequantum   NaN3     NaN4 -> 1
383ddsamq1734 samequantum  sNaN3     3    -> 0
384ddsamq1735 samequantum   NaN3     3    -> 0
385ddsamq1736 samequantum      4    sNaN4 -> 0
386ddsamq1737 samequantum      3     NaN3 -> 0
387ddsamq1738 samequantum    Inf    sNaN4 -> 0
388ddsamq1739 samequantum   -Inf     NaN3 -> 0
389
390