1------------------------------------------------------------------------
2-- compare.decTest -- decimal 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
26extended: 1
27
28precision:   9
29rounding:    half_up
30maxExponent: 999
31minexponent: -999
32
33-- sanity checks
34comx001 compare  -2  -2  -> 0
35comx002 compare  -2  -1  -> -1
36comx003 compare  -2   0  -> -1
37comx004 compare  -2   1  -> -1
38comx005 compare  -2   2  -> -1
39comx006 compare  -1  -2  -> 1
40comx007 compare  -1  -1  -> 0
41comx008 compare  -1   0  -> -1
42comx009 compare  -1   1  -> -1
43comx010 compare  -1   2  -> -1
44comx011 compare   0  -2  -> 1
45comx012 compare   0  -1  -> 1
46comx013 compare   0   0  -> 0
47comx014 compare   0   1  -> -1
48comx015 compare   0   2  -> -1
49comx016 compare   1  -2  -> 1
50comx017 compare   1  -1  -> 1
51comx018 compare   1   0  -> 1
52comx019 compare   1   1  -> 0
53comx020 compare   1   2  -> -1
54comx021 compare   2  -2  -> 1
55comx022 compare   2  -1  -> 1
56comx023 compare   2   0  -> 1
57comx025 compare   2   1  -> 1
58comx026 compare   2   2  -> 0
59
60comx031 compare  -20  -20  -> 0
61comx032 compare  -20  -10  -> -1
62comx033 compare  -20   00  -> -1
63comx034 compare  -20   10  -> -1
64comx035 compare  -20   20  -> -1
65comx036 compare  -10  -20  -> 1
66comx037 compare  -10  -10  -> 0
67comx038 compare  -10   00  -> -1
68comx039 compare  -10   10  -> -1
69comx040 compare  -10   20  -> -1
70comx041 compare   00  -20  -> 1
71comx042 compare   00  -10  -> 1
72comx043 compare   00   00  -> 0
73comx044 compare   00   10  -> -1
74comx045 compare   00   20  -> -1
75comx046 compare   10  -20  -> 1
76comx047 compare   10  -10  -> 1
77comx048 compare   10   00  -> 1
78comx049 compare   10   10  -> 0
79comx050 compare   10   20  -> -1
80comx051 compare   20  -20  -> 1
81comx052 compare   20  -10  -> 1
82comx053 compare   20   00  -> 1
83comx055 compare   20   10  -> 1
84comx056 compare   20   20  -> 0
85
86comx061 compare  -2.0  -2.0  -> 0
87comx062 compare  -2.0  -1.0  -> -1
88comx063 compare  -2.0   0.0  -> -1
89comx064 compare  -2.0   1.0  -> -1
90comx065 compare  -2.0   2.0  -> -1
91comx066 compare  -1.0  -2.0  -> 1
92comx067 compare  -1.0  -1.0  -> 0
93comx068 compare  -1.0   0.0  -> -1
94comx069 compare  -1.0   1.0  -> -1
95comx070 compare  -1.0   2.0  -> -1
96comx071 compare   0.0  -2.0  -> 1
97comx072 compare   0.0  -1.0  -> 1
98comx073 compare   0.0   0.0  -> 0
99comx074 compare   0.0   1.0  -> -1
100comx075 compare   0.0   2.0  -> -1
101comx076 compare   1.0  -2.0  -> 1
102comx077 compare   1.0  -1.0  -> 1
103comx078 compare   1.0   0.0  -> 1
104comx079 compare   1.0   1.0  -> 0
105comx080 compare   1.0   2.0  -> -1
106comx081 compare   2.0  -2.0  -> 1
107comx082 compare   2.0  -1.0  -> 1
108comx083 compare   2.0   0.0  -> 1
109comx085 compare   2.0   1.0  -> 1
110comx086 compare   2.0   2.0  -> 0
111
112-- now some cases which might overflow if subtract were used
113maxexponent: 999999999
114minexponent: -999999999
115comx095 compare  9.99999999E+999999999 9.99999999E+999999999  -> 0
116comx096 compare -9.99999999E+999999999 9.99999999E+999999999  -> -1
117comx097 compare  9.99999999E+999999999 -9.99999999E+999999999 -> 1
118comx098 compare -9.99999999E+999999999 -9.99999999E+999999999 -> 0
119
120-- some differing length/exponent cases
121comx100 compare   7.0    7.0    -> 0
122comx101 compare   7.0    7      -> 0
123comx102 compare   7      7.0    -> 0
124comx103 compare   7E+0   7.0    -> 0
125comx104 compare   70E-1  7.0    -> 0
126comx105 compare   0.7E+1 7      -> 0
127comx106 compare   70E-1  7      -> 0
128comx107 compare   7.0    7E+0   -> 0
129comx108 compare   7.0    70E-1  -> 0
130comx109 compare   7      0.7E+1 -> 0
131comx110 compare   7      70E-1  -> 0
132
133comx120 compare   8.0    7.0    -> 1
134comx121 compare   8.0    7      -> 1
135comx122 compare   8      7.0    -> 1
136comx123 compare   8E+0   7.0    -> 1
137comx124 compare   80E-1  7.0    -> 1
138comx125 compare   0.8E+1 7      -> 1
139comx126 compare   80E-1  7      -> 1
140comx127 compare   8.0    7E+0   -> 1
141comx128 compare   8.0    70E-1  -> 1
142comx129 compare   8      0.7E+1  -> 1
143comx130 compare   8      70E-1  -> 1
144
145comx140 compare   8.0    9.0    -> -1
146comx141 compare   8.0    9      -> -1
147comx142 compare   8      9.0    -> -1
148comx143 compare   8E+0   9.0    -> -1
149comx144 compare   80E-1  9.0    -> -1
150comx145 compare   0.8E+1 9      -> -1
151comx146 compare   80E-1  9      -> -1
152comx147 compare   8.0    9E+0   -> -1
153comx148 compare   8.0    90E-1  -> -1
154comx149 compare   8      0.9E+1 -> -1
155comx150 compare   8      90E-1  -> -1
156
157-- and again, with sign changes -+ ..
158comx200 compare  -7.0    7.0    -> -1
159comx201 compare  -7.0    7      -> -1
160comx202 compare  -7      7.0    -> -1
161comx203 compare  -7E+0   7.0    -> -1
162comx204 compare  -70E-1  7.0    -> -1
163comx205 compare  -0.7E+1 7      -> -1
164comx206 compare  -70E-1  7      -> -1
165comx207 compare  -7.0    7E+0   -> -1
166comx208 compare  -7.0    70E-1  -> -1
167comx209 compare  -7      0.7E+1 -> -1
168comx210 compare  -7      70E-1  -> -1
169
170comx220 compare  -8.0    7.0    -> -1
171comx221 compare  -8.0    7      -> -1
172comx222 compare  -8      7.0    -> -1
173comx223 compare  -8E+0   7.0    -> -1
174comx224 compare  -80E-1  7.0    -> -1
175comx225 compare  -0.8E+1 7      -> -1
176comx226 compare  -80E-1  7      -> -1
177comx227 compare  -8.0    7E+0   -> -1
178comx228 compare  -8.0    70E-1  -> -1
179comx229 compare  -8      0.7E+1 -> -1
180comx230 compare  -8      70E-1  -> -1
181
182comx240 compare  -8.0    9.0    -> -1
183comx241 compare  -8.0    9      -> -1
184comx242 compare  -8      9.0    -> -1
185comx243 compare  -8E+0   9.0    -> -1
186comx244 compare  -80E-1  9.0    -> -1
187comx245 compare  -0.8E+1 9      -> -1
188comx246 compare  -80E-1  9      -> -1
189comx247 compare  -8.0    9E+0   -> -1
190comx248 compare  -8.0    90E-1  -> -1
191comx249 compare  -8      0.9E+1 -> -1
192comx250 compare  -8      90E-1  -> -1
193
194-- and again, with sign changes +- ..
195comx300 compare   7.0    -7.0    -> 1
196comx301 compare   7.0    -7      -> 1
197comx302 compare   7      -7.0    -> 1
198comx303 compare   7E+0   -7.0    -> 1
199comx304 compare   70E-1  -7.0    -> 1
200comx305 compare   .7E+1  -7      -> 1
201comx306 compare   70E-1  -7      -> 1
202comx307 compare   7.0    -7E+0   -> 1
203comx308 compare   7.0    -70E-1  -> 1
204comx309 compare   7      -.7E+1  -> 1
205comx310 compare   7      -70E-1  -> 1
206
207comx320 compare   8.0    -7.0    -> 1
208comx321 compare   8.0    -7      -> 1
209comx322 compare   8      -7.0    -> 1
210comx323 compare   8E+0   -7.0    -> 1
211comx324 compare   80E-1  -7.0    -> 1
212comx325 compare   .8E+1  -7      -> 1
213comx326 compare   80E-1  -7      -> 1
214comx327 compare   8.0    -7E+0   -> 1
215comx328 compare   8.0    -70E-1  -> 1
216comx329 compare   8      -.7E+1  -> 1
217comx330 compare   8      -70E-1  -> 1
218
219comx340 compare   8.0    -9.0    -> 1
220comx341 compare   8.0    -9      -> 1
221comx342 compare   8      -9.0    -> 1
222comx343 compare   8E+0   -9.0    -> 1
223comx344 compare   80E-1  -9.0    -> 1
224comx345 compare   .8E+1  -9      -> 1
225comx346 compare   80E-1  -9      -> 1
226comx347 compare   8.0    -9E+0   -> 1
227comx348 compare   8.0    -90E-1  -> 1
228comx349 compare   8      -.9E+1  -> 1
229comx350 compare   8      -90E-1  -> 1
230
231-- and again, with sign changes -- ..
232comx400 compare   -7.0    -7.0    -> 0
233comx401 compare   -7.0    -7      -> 0
234comx402 compare   -7      -7.0    -> 0
235comx403 compare   -7E+0   -7.0    -> 0
236comx404 compare   -70E-1  -7.0    -> 0
237comx405 compare   -.7E+1  -7      -> 0
238comx406 compare   -70E-1  -7      -> 0
239comx407 compare   -7.0    -7E+0   -> 0
240comx408 compare   -7.0    -70E-1  -> 0
241comx409 compare   -7      -.7E+1  -> 0
242comx410 compare   -7      -70E-1  -> 0
243
244comx420 compare   -8.0    -7.0    -> -1
245comx421 compare   -8.0    -7      -> -1
246comx422 compare   -8      -7.0    -> -1
247comx423 compare   -8E+0   -7.0    -> -1
248comx424 compare   -80E-1  -7.0    -> -1
249comx425 compare   -.8E+1  -7      -> -1
250comx426 compare   -80E-1  -7      -> -1
251comx427 compare   -8.0    -7E+0   -> -1
252comx428 compare   -8.0    -70E-1  -> -1
253comx429 compare   -8      -.7E+1  -> -1
254comx430 compare   -8      -70E-1  -> -1
255
256comx440 compare   -8.0    -9.0    -> 1
257comx441 compare   -8.0    -9      -> 1
258comx442 compare   -8      -9.0    -> 1
259comx443 compare   -8E+0   -9.0    -> 1
260comx444 compare   -80E-1  -9.0    -> 1
261comx445 compare   -.8E+1  -9      -> 1
262comx446 compare   -80E-1  -9      -> 1
263comx447 compare   -8.0    -9E+0   -> 1
264comx448 compare   -8.0    -90E-1  -> 1
265comx449 compare   -8      -.9E+1  -> 1
266comx450 compare   -8      -90E-1  -> 1
267
268-- misalignment traps for little-endian
269comx451 compare      1.0       0.1  -> 1
270comx452 compare      0.1       1.0  -> -1
271comx453 compare     10.0       0.1  -> 1
272comx454 compare      0.1      10.0  -> -1
273comx455 compare      100       1.0  -> 1
274comx456 compare      1.0       100  -> -1
275comx457 compare     1000      10.0  -> 1
276comx458 compare     10.0      1000  -> -1
277comx459 compare    10000     100.0  -> 1
278comx460 compare    100.0     10000  -> -1
279comx461 compare   100000    1000.0  -> 1
280comx462 compare   1000.0    100000  -> -1
281comx463 compare  1000000   10000.0  -> 1
282comx464 compare  10000.0   1000000  -> -1
283
284-- testcases that subtract to lots of zeros at boundaries [pgr]
285precision: 40
286comx470 compare 123.4560000000000000E789 123.456E789 -> 0
287comx471 compare 123.456000000000000E-89 123.456E-89 -> 0
288comx472 compare 123.45600000000000E789 123.456E789 -> 0
289comx473 compare 123.4560000000000E-89 123.456E-89 -> 0
290comx474 compare 123.456000000000E789 123.456E789 -> 0
291comx475 compare 123.45600000000E-89 123.456E-89 -> 0
292comx476 compare 123.4560000000E789 123.456E789 -> 0
293comx477 compare 123.456000000E-89 123.456E-89 -> 0
294comx478 compare 123.45600000E789 123.456E789 -> 0
295comx479 compare 123.4560000E-89 123.456E-89 -> 0
296comx480 compare 123.456000E789 123.456E789 -> 0
297comx481 compare 123.45600E-89 123.456E-89 -> 0
298comx482 compare 123.4560E789 123.456E789 -> 0
299comx483 compare 123.456E-89 123.456E-89 -> 0
300comx484 compare 123.456E-89 123.4560000000000000E-89 -> 0
301comx485 compare 123.456E789 123.456000000000000E789 -> 0
302comx486 compare 123.456E-89 123.45600000000000E-89 -> 0
303comx487 compare 123.456E789 123.4560000000000E789 -> 0
304comx488 compare 123.456E-89 123.456000000000E-89 -> 0
305comx489 compare 123.456E789 123.45600000000E789 -> 0
306comx490 compare 123.456E-89 123.4560000000E-89 -> 0
307comx491 compare 123.456E789 123.456000000E789 -> 0
308comx492 compare 123.456E-89 123.45600000E-89 -> 0
309comx493 compare 123.456E789 123.4560000E789 -> 0
310comx494 compare 123.456E-89 123.456000E-89 -> 0
311comx495 compare 123.456E789 123.45600E789 -> 0
312comx496 compare 123.456E-89 123.4560E-89 -> 0
313comx497 compare 123.456E789 123.456E789 -> 0
314
315-- wide-ranging, around precision; signs equal
316precision: 9
317comx500 compare    1     1E-15    -> 1
318comx501 compare    1     1E-14    -> 1
319comx502 compare    1     1E-13    -> 1
320comx503 compare    1     1E-12    -> 1
321comx504 compare    1     1E-11    -> 1
322comx505 compare    1     1E-10    -> 1
323comx506 compare    1     1E-9     -> 1
324comx507 compare    1     1E-8     -> 1
325comx508 compare    1     1E-7     -> 1
326comx509 compare    1     1E-6     -> 1
327comx510 compare    1     1E-5     -> 1
328comx511 compare    1     1E-4     -> 1
329comx512 compare    1     1E-3     -> 1
330comx513 compare    1     1E-2     -> 1
331comx514 compare    1     1E-1     -> 1
332comx515 compare    1     1E-0     -> 0
333comx516 compare    1     1E+1     -> -1
334comx517 compare    1     1E+2     -> -1
335comx518 compare    1     1E+3     -> -1
336comx519 compare    1     1E+4     -> -1
337comx521 compare    1     1E+5     -> -1
338comx522 compare    1     1E+6     -> -1
339comx523 compare    1     1E+7     -> -1
340comx524 compare    1     1E+8     -> -1
341comx525 compare    1     1E+9     -> -1
342comx526 compare    1     1E+10    -> -1
343comx527 compare    1     1E+11    -> -1
344comx528 compare    1     1E+12    -> -1
345comx529 compare    1     1E+13    -> -1
346comx530 compare    1     1E+14    -> -1
347comx531 compare    1     1E+15    -> -1
348-- LR swap
349comx540 compare    1E-15  1       -> -1
350comx541 compare    1E-14  1       -> -1
351comx542 compare    1E-13  1       -> -1
352comx543 compare    1E-12  1       -> -1
353comx544 compare    1E-11  1       -> -1
354comx545 compare    1E-10  1       -> -1
355comx546 compare    1E-9   1       -> -1
356comx547 compare    1E-8   1       -> -1
357comx548 compare    1E-7   1       -> -1
358comx549 compare    1E-6   1       -> -1
359comx550 compare    1E-5   1       -> -1
360comx551 compare    1E-4   1       -> -1
361comx552 compare    1E-3   1       -> -1
362comx553 compare    1E-2   1       -> -1
363comx554 compare    1E-1   1       -> -1
364comx555 compare    1E-0   1       ->  0
365comx556 compare    1E+1   1       ->  1
366comx557 compare    1E+2   1       ->  1
367comx558 compare    1E+3   1       ->  1
368comx559 compare    1E+4   1       ->  1
369comx561 compare    1E+5   1       ->  1
370comx562 compare    1E+6   1       ->  1
371comx563 compare    1E+7   1       ->  1
372comx564 compare    1E+8   1       ->  1
373comx565 compare    1E+9   1       ->  1
374comx566 compare    1E+10  1       ->  1
375comx567 compare    1E+11  1       ->  1
376comx568 compare    1E+12  1       ->  1
377comx569 compare    1E+13  1       ->  1
378comx570 compare    1E+14  1       ->  1
379comx571 compare    1E+15  1       ->  1
380-- similar with a useful coefficient, one side only
381comx580 compare  0.000000987654321     1E-15    -> 1
382comx581 compare  0.000000987654321     1E-14    -> 1
383comx582 compare  0.000000987654321     1E-13    -> 1
384comx583 compare  0.000000987654321     1E-12    -> 1
385comx584 compare  0.000000987654321     1E-11    -> 1
386comx585 compare  0.000000987654321     1E-10    -> 1
387comx586 compare  0.000000987654321     1E-9     -> 1
388comx587 compare  0.000000987654321     1E-8     -> 1
389comx588 compare  0.000000987654321     1E-7     -> 1
390comx589 compare  0.000000987654321     1E-6     -> -1
391comx590 compare  0.000000987654321     1E-5     -> -1
392comx591 compare  0.000000987654321     1E-4     -> -1
393comx592 compare  0.000000987654321     1E-3     -> -1
394comx593 compare  0.000000987654321     1E-2     -> -1
395comx594 compare  0.000000987654321     1E-1     -> -1
396comx595 compare  0.000000987654321     1E-0     -> -1
397comx596 compare  0.000000987654321     1E+1     -> -1
398comx597 compare  0.000000987654321     1E+2     -> -1
399comx598 compare  0.000000987654321     1E+3     -> -1
400comx599 compare  0.000000987654321     1E+4     -> -1
401
402-- check some unit-y traps
403precision: 20
404comx600 compare   12            12.2345 -> -1
405comx601 compare   12.0          12.2345 -> -1
406comx602 compare   12.00         12.2345 -> -1
407comx603 compare   12.000        12.2345 -> -1
408comx604 compare   12.0000       12.2345 -> -1
409comx605 compare   12.00000      12.2345 -> -1
410comx606 compare   12.000000     12.2345 -> -1
411comx607 compare   12.0000000    12.2345 -> -1
412comx608 compare   12.00000000   12.2345 -> -1
413comx609 compare   12.000000000  12.2345 -> -1
414comx610 compare   12.1234 12            ->  1
415comx611 compare   12.1234 12.0          ->  1
416comx612 compare   12.1234 12.00         ->  1
417comx613 compare   12.1234 12.000        ->  1
418comx614 compare   12.1234 12.0000       ->  1
419comx615 compare   12.1234 12.00000      ->  1
420comx616 compare   12.1234 12.000000     ->  1
421comx617 compare   12.1234 12.0000000    ->  1
422comx618 compare   12.1234 12.00000000   ->  1
423comx619 compare   12.1234 12.000000000  ->  1
424comx620 compare  -12           -12.2345 ->  1
425comx621 compare  -12.0         -12.2345 ->  1
426comx622 compare  -12.00        -12.2345 ->  1
427comx623 compare  -12.000       -12.2345 ->  1
428comx624 compare  -12.0000      -12.2345 ->  1
429comx625 compare  -12.00000     -12.2345 ->  1
430comx626 compare  -12.000000    -12.2345 ->  1
431comx627 compare  -12.0000000   -12.2345 ->  1
432comx628 compare  -12.00000000  -12.2345 ->  1
433comx629 compare  -12.000000000 -12.2345 ->  1
434comx630 compare  -12.1234 -12           -> -1
435comx631 compare  -12.1234 -12.0         -> -1
436comx632 compare  -12.1234 -12.00        -> -1
437comx633 compare  -12.1234 -12.000       -> -1
438comx634 compare  -12.1234 -12.0000      -> -1
439comx635 compare  -12.1234 -12.00000     -> -1
440comx636 compare  -12.1234 -12.000000    -> -1
441comx637 compare  -12.1234 -12.0000000   -> -1
442comx638 compare  -12.1234 -12.00000000  -> -1
443comx639 compare  -12.1234 -12.000000000 -> -1
444precision: 9
445
446-- extended zeros
447comx640 compare   0     0   -> 0
448comx641 compare   0    -0   -> 0
449comx642 compare   0    -0.0 -> 0
450comx643 compare   0     0.0 -> 0
451comx644 compare  -0     0   -> 0
452comx645 compare  -0    -0   -> 0
453comx646 compare  -0    -0.0 -> 0
454comx647 compare  -0     0.0 -> 0
455comx648 compare   0.0   0   -> 0
456comx649 compare   0.0  -0   -> 0
457comx650 compare   0.0  -0.0 -> 0
458comx651 compare   0.0   0.0 -> 0
459comx652 compare  -0.0   0   -> 0
460comx653 compare  -0.0  -0   -> 0
461comx654 compare  -0.0  -0.0 -> 0
462comx655 compare  -0.0   0.0 -> 0
463
464comx656 compare  -0E1   0.0 -> 0
465comx657 compare  -0E2   0.0 -> 0
466comx658 compare   0E1   0.0 -> 0
467comx659 compare   0E2   0.0 -> 0
468comx660 compare  -0E1   0   -> 0
469comx661 compare  -0E2   0   -> 0
470comx662 compare   0E1   0   -> 0
471comx663 compare   0E2   0   -> 0
472comx664 compare  -0E1  -0E1 -> 0
473comx665 compare  -0E2  -0E1 -> 0
474comx666 compare   0E1  -0E1 -> 0
475comx667 compare   0E2  -0E1 -> 0
476comx668 compare  -0E1  -0E2 -> 0
477comx669 compare  -0E2  -0E2 -> 0
478comx670 compare   0E1  -0E2 -> 0
479comx671 compare   0E2  -0E2 -> 0
480comx672 compare  -0E1   0E1 -> 0
481comx673 compare  -0E2   0E1 -> 0
482comx674 compare   0E1   0E1 -> 0
483comx675 compare   0E2   0E1 -> 0
484comx676 compare  -0E1   0E2 -> 0
485comx677 compare  -0E2   0E2 -> 0
486comx678 compare   0E1   0E2 -> 0
487comx679 compare   0E2   0E2 -> 0
488
489-- trailing zeros; unit-y
490precision: 20
491comx680 compare   12    12           -> 0
492comx681 compare   12    12.0         -> 0
493comx682 compare   12    12.00        -> 0
494comx683 compare   12    12.000       -> 0
495comx684 compare   12    12.0000      -> 0
496comx685 compare   12    12.00000     -> 0
497comx686 compare   12    12.000000    -> 0
498comx687 compare   12    12.0000000   -> 0
499comx688 compare   12    12.00000000  -> 0
500comx689 compare   12    12.000000000 -> 0
501comx690 compare   12              12 -> 0
502comx691 compare   12.0            12 -> 0
503comx692 compare   12.00           12 -> 0
504comx693 compare   12.000          12 -> 0
505comx694 compare   12.0000         12 -> 0
506comx695 compare   12.00000        12 -> 0
507comx696 compare   12.000000       12 -> 0
508comx697 compare   12.0000000      12 -> 0
509comx698 compare   12.00000000     12 -> 0
510comx699 compare   12.000000000    12 -> 0
511
512-- long operand checks
513maxexponent: 999
514minexponent: -999
515precision: 9
516comx701 compare 12345678000  1 ->  1
517comx702 compare 1 12345678000  -> -1
518comx703 compare 1234567800   1 ->  1
519comx704 compare 1 1234567800   -> -1
520comx705 compare 1234567890   1 ->  1
521comx706 compare 1 1234567890   -> -1
522comx707 compare 1234567891   1 ->  1
523comx708 compare 1 1234567891   -> -1
524comx709 compare 12345678901  1 ->  1
525comx710 compare 1 12345678901  -> -1
526comx711 compare 1234567896   1 ->  1
527comx712 compare 1 1234567896   -> -1
528comx713 compare -1234567891  1 -> -1
529comx714 compare 1 -1234567891  ->  1
530comx715 compare -12345678901 1 -> -1
531comx716 compare 1 -12345678901 ->  1
532comx717 compare -1234567896  1 -> -1
533comx718 compare 1 -1234567896  ->  1
534
535precision: 15
536-- same with plenty of precision
537comx721 compare 12345678000 1 -> 1
538comx722 compare 1 12345678000 -> -1
539comx723 compare 1234567800  1 -> 1
540comx724 compare 1 1234567800  -> -1
541comx725 compare 1234567890  1 -> 1
542comx726 compare 1 1234567890  -> -1
543comx727 compare 1234567891  1 -> 1
544comx728 compare 1 1234567891  -> -1
545comx729 compare 12345678901 1 -> 1
546comx730 compare 1 12345678901 -> -1
547comx731 compare 1234567896  1 -> 1
548comx732 compare 1 1234567896  -> -1
549
550-- residue cases
551precision: 5
552comx740 compare  1  0.9999999  -> 1
553comx741 compare  1  0.999999   -> 1
554comx742 compare  1  0.99999    -> 1
555comx743 compare  1  1.0000     -> 0
556comx744 compare  1  1.00001    -> -1
557comx745 compare  1  1.000001   -> -1
558comx746 compare  1  1.0000001  -> -1
559comx750 compare  0.9999999  1  -> -1
560comx751 compare  0.999999   1  -> -1
561comx752 compare  0.99999    1  -> -1
562comx753 compare  1.0000     1  -> 0
563comx754 compare  1.00001    1  -> 1
564comx755 compare  1.000001   1  -> 1
565comx756 compare  1.0000001  1  -> 1
566
567-- a selection of longies
568comx760 compare -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> -1
569comx761 compare -36852134.84194296250843579428931 -36852134.84194296250843579428931  -> 0
570comx762 compare -36852134.94194296250843579428931 -36852134.84194296250843579428931  -> -1
571comx763 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1
572-- precisions above or below the difference should have no effect
573precision:   11
574comx764 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1
575precision:   10
576comx765 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1
577precision:    9
578comx766 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1
579precision:    8
580comx767 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1
581precision:    7
582comx768 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1
583precision:    6
584comx769 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1
585precision:    5
586comx770 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1
587precision:    4
588comx771 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1
589precision:    3
590comx772 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1
591precision:    2
592comx773 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1
593precision:    1
594comx774 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1
595
596-- Specials
597precision:   9
598comx780 compare  Inf  -Inf   ->  1
599comx781 compare  Inf  -1000  ->  1
600comx782 compare  Inf  -1     ->  1
601comx783 compare  Inf  -0     ->  1
602comx784 compare  Inf   0     ->  1
603comx785 compare  Inf   1     ->  1
604comx786 compare  Inf   1000  ->  1
605comx787 compare  Inf   Inf   ->  0
606comx788 compare -1000  Inf   -> -1
607comx789 compare -Inf   Inf   -> -1
608comx790 compare -1     Inf   -> -1
609comx791 compare -0     Inf   -> -1
610comx792 compare  0     Inf   -> -1
611comx793 compare  1     Inf   -> -1
612comx794 compare  1000  Inf   -> -1
613comx795 compare  Inf   Inf   ->  0
614
615comx800 compare -Inf  -Inf   ->  0
616comx801 compare -Inf  -1000  -> -1
617comx802 compare -Inf  -1     -> -1
618comx803 compare -Inf  -0     -> -1
619comx804 compare -Inf   0     -> -1
620comx805 compare -Inf   1     -> -1
621comx806 compare -Inf   1000  -> -1
622comx807 compare -Inf   Inf   -> -1
623comx808 compare -Inf  -Inf   ->  0
624comx809 compare -1000 -Inf   ->  1
625comx810 compare -1    -Inf   ->  1
626comx811 compare -0    -Inf   ->  1
627comx812 compare  0    -Inf   ->  1
628comx813 compare  1    -Inf   ->  1
629comx814 compare  1000 -Inf   ->  1
630comx815 compare  Inf  -Inf   ->  1
631
632comx821 compare  NaN -Inf    ->  NaN
633comx822 compare  NaN -1000   ->  NaN
634comx823 compare  NaN -1      ->  NaN
635comx824 compare  NaN -0      ->  NaN
636comx825 compare  NaN  0      ->  NaN
637comx826 compare  NaN  1      ->  NaN
638comx827 compare  NaN  1000   ->  NaN
639comx828 compare  NaN  Inf    ->  NaN
640comx829 compare  NaN  NaN    ->  NaN
641comx830 compare -Inf  NaN    ->  NaN
642comx831 compare -1000 NaN    ->  NaN
643comx832 compare -1    NaN    ->  NaN
644comx833 compare -0    NaN    ->  NaN
645comx834 compare  0    NaN    ->  NaN
646comx835 compare  1    NaN    ->  NaN
647comx836 compare  1000 NaN    ->  NaN
648comx837 compare  Inf  NaN    ->  NaN
649comx838 compare -NaN -NaN    -> -NaN
650comx839 compare +NaN -NaN    ->  NaN
651comx840 compare -NaN +NaN    -> -NaN
652
653comx841 compare  sNaN -Inf   ->  NaN  Invalid_operation
654comx842 compare  sNaN -1000  ->  NaN  Invalid_operation
655comx843 compare  sNaN -1     ->  NaN  Invalid_operation
656comx844 compare  sNaN -0     ->  NaN  Invalid_operation
657comx845 compare  sNaN  0     ->  NaN  Invalid_operation
658comx846 compare  sNaN  1     ->  NaN  Invalid_operation
659comx847 compare  sNaN  1000  ->  NaN  Invalid_operation
660comx848 compare  sNaN  NaN   ->  NaN  Invalid_operation
661comx849 compare  sNaN sNaN   ->  NaN  Invalid_operation
662comx850 compare  NaN  sNaN   ->  NaN  Invalid_operation
663comx851 compare -Inf  sNaN   ->  NaN  Invalid_operation
664comx852 compare -1000 sNaN   ->  NaN  Invalid_operation
665comx853 compare -1    sNaN   ->  NaN  Invalid_operation
666comx854 compare -0    sNaN   ->  NaN  Invalid_operation
667comx855 compare  0    sNaN   ->  NaN  Invalid_operation
668comx856 compare  1    sNaN   ->  NaN  Invalid_operation
669comx857 compare  1000 sNaN   ->  NaN  Invalid_operation
670comx858 compare  Inf  sNaN   ->  NaN  Invalid_operation
671comx859 compare  NaN  sNaN   ->  NaN  Invalid_operation
672
673-- propagating NaNs
674comx860 compare  NaN9 -Inf   ->  NaN9
675comx861 compare  NaN8  999   ->  NaN8
676comx862 compare  NaN77 Inf   ->  NaN77
677comx863 compare -NaN67 NaN5  -> -NaN67
678comx864 compare -Inf  -NaN4  -> -NaN4
679comx865 compare -999  -NaN33 -> -NaN33
680comx866 compare  Inf   NaN2  ->  NaN2
681comx867 compare -NaN41 -NaN42 -> -NaN41
682comx868 compare +NaN41 -NaN42 ->  NaN41
683comx869 compare -NaN41 +NaN42 -> -NaN41
684comx870 compare +NaN41 +NaN42 ->  NaN41
685
686comx871 compare -sNaN99 -Inf    -> -NaN99 Invalid_operation
687comx872 compare  sNaN98 -11     ->  NaN98 Invalid_operation
688comx873 compare  sNaN97  NaN    ->  NaN97 Invalid_operation
689comx874 compare  sNaN16 sNaN94  ->  NaN16 Invalid_operation
690comx875 compare  NaN85  sNaN83  ->  NaN83 Invalid_operation
691comx876 compare -Inf    sNaN92  ->  NaN92 Invalid_operation
692comx877 compare  088    sNaN81  ->  NaN81 Invalid_operation
693comx878 compare  Inf    sNaN90  ->  NaN90 Invalid_operation
694comx879 compare  NaN   -sNaN89  -> -NaN89 Invalid_operation
695
696-- overflow and underflow tests .. subnormal results now allowed
697maxExponent: 999999999
698minexponent: -999999999
699comx880 compare +1.23456789012345E-0 9E+999999999 -> -1
700comx881 compare 9E+999999999 +1.23456789012345E-0 ->  1
701comx882 compare +0.100 9E-999999999               ->  1
702comx883 compare 9E-999999999 +0.100               -> -1
703comx885 compare -1.23456789012345E-0 9E+999999999 -> -1
704comx886 compare 9E+999999999 -1.23456789012345E-0 ->  1
705comx887 compare -0.100 9E-999999999               -> -1
706comx888 compare 9E-999999999 -0.100               ->  1
707
708comx889 compare 1e-599999999 1e-400000001   -> -1
709comx890 compare 1e-599999999 1e-400000000   -> -1
710comx891 compare 1e-600000000 1e-400000000   -> -1
711comx892 compare 9e-999999998 0.01           -> -1
712comx893 compare 9e-999999998 0.1            -> -1
713comx894 compare 0.01 9e-999999998           ->  1
714comx895 compare 1e599999999 1e400000001     ->  1
715comx896 compare 1e599999999 1e400000000     ->  1
716comx897 compare 1e600000000 1e400000000     ->  1
717comx898 compare 9e999999998 100             ->  1
718comx899 compare 9e999999998 10              ->  1
719comx900 compare 100  9e999999998            -> -1
720-- signs
721comx901 compare  1e+777777777  1e+411111111 ->  1
722comx902 compare  1e+777777777 -1e+411111111 ->  1
723comx903 compare -1e+777777777  1e+411111111 -> -1
724comx904 compare -1e+777777777 -1e+411111111 -> -1
725comx905 compare  1e-777777777  1e-411111111 -> -1
726comx906 compare  1e-777777777 -1e-411111111 ->  1
727comx907 compare -1e-777777777  1e-411111111 -> -1
728comx908 compare -1e-777777777 -1e-411111111 ->  1
729
730-- spread zeros
731comx910 compare   0E-383  0       ->  0
732comx911 compare   0E-383 -0       ->  0
733comx912 compare  -0E-383  0       ->  0
734comx913 compare  -0E-383 -0       ->  0
735comx914 compare   0E-383  0E+384  ->  0
736comx915 compare   0E-383 -0E+384  ->  0
737comx916 compare  -0E-383  0E+384  ->  0
738comx917 compare  -0E-383 -0E+384  ->  0
739comx918 compare   0       0E+384  ->  0
740comx919 compare   0      -0E+384  ->  0
741comx920 compare  -0       0E+384  ->  0
742comx921 compare  -0      -0E+384  ->  0
743comx930 compare   0E+384  0       ->  0
744comx931 compare   0E+384 -0       ->  0
745comx932 compare  -0E+384  0       ->  0
746comx933 compare  -0E+384 -0       ->  0
747comx934 compare   0E+384  0E-383  ->  0
748comx935 compare   0E+384 -0E-383  ->  0
749comx936 compare  -0E+384  0E-383  ->  0
750comx937 compare  -0E+384 -0E-383  ->  0
751comx938 compare   0       0E-383  ->  0
752comx939 compare   0      -0E-383  ->  0
753comx940 compare  -0       0E-383  ->  0
754comx941 compare  -0      -0E-383  ->  0
755
756-- Null tests
757comx990 compare 10  # -> NaN Invalid_operation
758comx991 compare  # 10 -> NaN Invalid_operation
759