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