• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1------------------------------------------------------------------------
2-- samequantum.decTest -- check 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
22extended:    1
23precision:   9
24rounding:    half_up
25maxExponent: 999
26minExponent: -999
27
28samq001 samequantum  0      0      ->  1
29samq002 samequantum  0      1      ->  1
30samq003 samequantum  1      0      ->  1
31samq004 samequantum  1      1      ->  1
32
33samq011 samequantum  10     1E+1   -> 0
34samq012 samequantum  10E+1  10E+1  -> 1
35samq013 samequantum  100    10E+1  -> 0
36samq014 samequantum  100    1E+2   -> 0
37samq015 samequantum  0.1    1E-2   -> 0
38samq016 samequantum  0.1    1E-1   -> 1
39samq017 samequantum  0.1    1E-0   -> 0
40samq018 samequantum  999    999    -> 1
41samq019 samequantum  999E-1 99.9   -> 1
42samq020 samequantum  111E-1 22.2   -> 1
43samq021 samequantum  111E-1 1234.2 -> 1
44
45-- zeros
46samq030 samequantum  0.0    1.1    -> 1
47samq031 samequantum  0.0    1.11   -> 0
48samq032 samequantum  0.0    0      -> 0
49samq033 samequantum  0.0    0.0    -> 1
50samq034 samequantum  0.0    0.00   -> 0
51samq035 samequantum  0E+1   0E+0   -> 0
52samq036 samequantum  0E+1   0E+1   -> 1
53samq037 samequantum  0E+1   0E+2   -> 0
54samq038 samequantum  0E-17  0E-16  -> 0
55samq039 samequantum  0E-17  0E-17  -> 1
56samq040 samequantum  0E-17  0E-18  -> 0
57samq041 samequantum  0E-17  0.0E-15 -> 0
58samq042 samequantum  0E-17  0.0E-16 -> 1
59samq043 samequantum  0E-17  0.0E-17 -> 0
60samq044 samequantum -0E-17  0.0E-16 -> 1
61samq045 samequantum  0E-17 -0.0E-17 -> 0
62samq046 samequantum  0E-17 -0.0E-16 -> 1
63samq047 samequantum -0E-17  0.0E-17 -> 0
64samq048 samequantum -0E-17 -0.0E-16 -> 1
65samq049 samequantum -0E-17 -0.0E-17 -> 0
66
67-- Nmax, Nmin, Ntiny
68samq051 samequantum  9.99999999E+999    9.99999999E+999  -> 1
69samq052 samequantum  1E-999             1E-999           -> 1
70samq053 samequantum  1.00000000E-999    1.00000000E-999  -> 1
71samq054 samequantum  1E-1007            1E-1007          -> 1
72samq055 samequantum  9.99999999E+999    9.99999999E+999  -> 1
73samq056 samequantum  1E-999             1E-999           -> 1
74samq057 samequantum  1.00000000E-999    1.00000000E-999  -> 1
75samq058 samequantum  1E-1007            1E-1007          -> 1
76
77samq061 samequantum  -1E-1007           -1E-1007         -> 1
78samq062 samequantum  -1.00000000E-999   -1.00000000E-999 -> 1
79samq063 samequantum  -1E-999            -1E-999          -> 1
80samq064 samequantum  -9.99999999E+999   -9.99999999E+999 -> 1
81samq065 samequantum  -1E-1007           -1E-1007         -> 1
82samq066 samequantum  -1.00000000E-999   -1.00000000E-999 -> 1
83samq067 samequantum  -1E-999            -1E-999          -> 1
84samq068 samequantum  -9.99999999E+999   -9.99999999E+999 -> 1
85
86samq071 samequantum  -4E-1007           -1E-1007         -> 1
87samq072 samequantum  -4.00000000E-999   -1.00004000E-999 -> 1
88samq073 samequantum  -4E-999            -1E-999          -> 1
89samq074 samequantum  -4.99999999E+999   -9.99949999E+999 -> 1
90samq075 samequantum  -4E-1007           -1E-1007         -> 1
91samq076 samequantum  -4.00000000E-999   -1.00400000E-999 -> 1
92samq077 samequantum  -4E-999            -1E-999          -> 1
93samq078 samequantum  -4.99999999E+999   -9.94999999E+999 -> 1
94
95samq081 samequantum  -4E-1006           -1E-1007         -> 0
96samq082 samequantum  -4.00000000E-999   -1.00004000E-996 -> 0
97samq083 samequantum  -4E-996            -1E-999          -> 0
98samq084 samequantum  -4.99999999E+999   -9.99949999E+996 -> 0
99samq085 samequantum  -4E-1006           -1E-1007         -> 0
100samq086 samequantum  -4.00000000E-999   -1.00400000E-996 -> 0
101samq087 samequantum  -4E-996            -1E-999          -> 0
102samq088 samequantum  -4.99999999E+999   -9.94999999E+996 -> 0
103
104-- specials & combinations
105samq0110 samequantum  -Inf    -Inf   -> 1
106samq0111 samequantum  -Inf     Inf   -> 1
107samq0112 samequantum  -Inf     NaN   -> 0
108samq0113 samequantum  -Inf    -7E+3  -> 0
109samq0114 samequantum  -Inf    -7     -> 0
110samq0115 samequantum  -Inf    -7E-3  -> 0
111samq0116 samequantum  -Inf    -0E-3  -> 0
112samq0117 samequantum  -Inf    -0     -> 0
113samq0118 samequantum  -Inf    -0E+3  -> 0
114samq0119 samequantum  -Inf     0E-3  -> 0
115samq0120 samequantum  -Inf     0     -> 0
116samq0121 samequantum  -Inf     0E+3  -> 0
117samq0122 samequantum  -Inf     7E-3  -> 0
118samq0123 samequantum  -Inf     7     -> 0
119samq0124 samequantum  -Inf     7E+3  -> 0
120samq0125 samequantum  -Inf     sNaN  -> 0
121
122samq0210 samequantum   Inf    -Inf   -> 1
123samq0211 samequantum   Inf     Inf   -> 1
124samq0212 samequantum   Inf     NaN   -> 0
125samq0213 samequantum   Inf    -7E+3  -> 0
126samq0214 samequantum   Inf    -7     -> 0
127samq0215 samequantum   Inf    -7E-3  -> 0
128samq0216 samequantum   Inf    -0E-3  -> 0
129samq0217 samequantum   Inf    -0     -> 0
130samq0218 samequantum   Inf    -0E+3  -> 0
131samq0219 samequantum   Inf     0E-3  -> 0
132samq0220 samequantum   Inf     0     -> 0
133samq0221 samequantum   Inf     0E+3  -> 0
134samq0222 samequantum   Inf     7E-3  -> 0
135samq0223 samequantum   Inf     7     -> 0
136samq0224 samequantum   Inf     7E+3  -> 0
137samq0225 samequantum   Inf     sNaN  -> 0
138
139samq0310 samequantum   NaN    -Inf   -> 0
140samq0311 samequantum   NaN     Inf   -> 0
141samq0312 samequantum   NaN     NaN   -> 1
142samq0313 samequantum   NaN    -7E+3  -> 0
143samq0314 samequantum   NaN    -7     -> 0
144samq0315 samequantum   NaN    -7E-3  -> 0
145samq0316 samequantum   NaN    -0E-3  -> 0
146samq0317 samequantum   NaN    -0     -> 0
147samq0318 samequantum   NaN    -0E+3  -> 0
148samq0319 samequantum   NaN     0E-3  -> 0
149samq0320 samequantum   NaN     0     -> 0
150samq0321 samequantum   NaN     0E+3  -> 0
151samq0322 samequantum   NaN     7E-3  -> 0
152samq0323 samequantum   NaN     7     -> 0
153samq0324 samequantum   NaN     7E+3  -> 0
154samq0325 samequantum   NaN     sNaN  -> 1
155
156samq0410 samequantum  -7E+3    -Inf   -> 0
157samq0411 samequantum  -7E+3     Inf   -> 0
158samq0412 samequantum  -7E+3     NaN   -> 0
159samq0413 samequantum  -7E+3    -7E+3  -> 1
160samq0414 samequantum  -7E+3    -7     -> 0
161samq0415 samequantum  -7E+3    -7E-3  -> 0
162samq0416 samequantum  -7E+3    -0E-3  -> 0
163samq0417 samequantum  -7E+3    -0     -> 0
164samq0418 samequantum  -7E+3    -0E+3  -> 1
165samq0419 samequantum  -7E+3     0E-3  -> 0
166samq0420 samequantum  -7E+3     0     -> 0
167samq0421 samequantum  -7E+3     0E+3  -> 1
168samq0422 samequantum  -7E+3     7E-3  -> 0
169samq0423 samequantum  -7E+3     7     -> 0
170samq0424 samequantum  -7E+3     7E+3  -> 1
171samq0425 samequantum  -7E+3     sNaN  -> 0
172
173samq0510 samequantum  -7      -Inf   -> 0
174samq0511 samequantum  -7       Inf   -> 0
175samq0512 samequantum  -7       NaN   -> 0
176samq0513 samequantum  -7      -7E+3  -> 0
177samq0514 samequantum  -7      -7     -> 1
178samq0515 samequantum  -7      -7E-3  -> 0
179samq0516 samequantum  -7      -0E-3  -> 0
180samq0517 samequantum  -7      -0     -> 1
181samq0518 samequantum  -7      -0E+3  -> 0
182samq0519 samequantum  -7       0E-3  -> 0
183samq0520 samequantum  -7       0     -> 1
184samq0521 samequantum  -7       0E+3  -> 0
185samq0522 samequantum  -7       7E-3  -> 0
186samq0523 samequantum  -7       7     -> 1
187samq0524 samequantum  -7       7E+3  -> 0
188samq0525 samequantum  -7       sNaN  -> 0
189
190samq0610 samequantum  -7E-3    -Inf   -> 0
191samq0611 samequantum  -7E-3     Inf   -> 0
192samq0612 samequantum  -7E-3     NaN   -> 0
193samq0613 samequantum  -7E-3    -7E+3  -> 0
194samq0614 samequantum  -7E-3    -7     -> 0
195samq0615 samequantum  -7E-3    -7E-3  -> 1
196samq0616 samequantum  -7E-3    -0E-3  -> 1
197samq0617 samequantum  -7E-3    -0     -> 0
198samq0618 samequantum  -7E-3    -0E+3  -> 0
199samq0619 samequantum  -7E-3     0E-3  -> 1
200samq0620 samequantum  -7E-3     0     -> 0
201samq0621 samequantum  -7E-3     0E+3  -> 0
202samq0622 samequantum  -7E-3     7E-3  -> 1
203samq0623 samequantum  -7E-3     7     -> 0
204samq0624 samequantum  -7E-3     7E+3  -> 0
205samq0625 samequantum  -7E-3     sNaN  -> 0
206
207samq0710 samequantum  -0E-3    -Inf   -> 0
208samq0711 samequantum  -0E-3     Inf   -> 0
209samq0712 samequantum  -0E-3     NaN   -> 0
210samq0713 samequantum  -0E-3    -7E+3  -> 0
211samq0714 samequantum  -0E-3    -7     -> 0
212samq0715 samequantum  -0E-3    -7E-3  -> 1
213samq0716 samequantum  -0E-3    -0E-3  -> 1
214samq0717 samequantum  -0E-3    -0     -> 0
215samq0718 samequantum  -0E-3    -0E+3  -> 0
216samq0719 samequantum  -0E-3     0E-3  -> 1
217samq0720 samequantum  -0E-3     0     -> 0
218samq0721 samequantum  -0E-3     0E+3  -> 0
219samq0722 samequantum  -0E-3     7E-3  -> 1
220samq0723 samequantum  -0E-3     7     -> 0
221samq0724 samequantum  -0E-3     7E+3  -> 0
222samq0725 samequantum  -0E-3     sNaN  -> 0
223
224samq0810 samequantum  -0      -Inf   -> 0
225samq0811 samequantum  -0       Inf   -> 0
226samq0812 samequantum  -0       NaN   -> 0
227samq0813 samequantum  -0      -7E+3  -> 0
228samq0814 samequantum  -0      -7     -> 1
229samq0815 samequantum  -0      -7E-3  -> 0
230samq0816 samequantum  -0      -0E-3  -> 0
231samq0817 samequantum  -0      -0     -> 1
232samq0818 samequantum  -0      -0E+3  -> 0
233samq0819 samequantum  -0       0E-3  -> 0
234samq0820 samequantum  -0       0     -> 1
235samq0821 samequantum  -0       0E+3  -> 0
236samq0822 samequantum  -0       7E-3  -> 0
237samq0823 samequantum  -0       7     -> 1
238samq0824 samequantum  -0       7E+3  -> 0
239samq0825 samequantum  -0       sNaN  -> 0
240
241samq0910 samequantum  -0E+3    -Inf   -> 0
242samq0911 samequantum  -0E+3     Inf   -> 0
243samq0912 samequantum  -0E+3     NaN   -> 0
244samq0913 samequantum  -0E+3    -7E+3  -> 1
245samq0914 samequantum  -0E+3    -7     -> 0
246samq0915 samequantum  -0E+3    -7E-3  -> 0
247samq0916 samequantum  -0E+3    -0E-3  -> 0
248samq0917 samequantum  -0E+3    -0     -> 0
249samq0918 samequantum  -0E+3    -0E+3  -> 1
250samq0919 samequantum  -0E+3     0E-3  -> 0
251samq0920 samequantum  -0E+3     0     -> 0
252samq0921 samequantum  -0E+3     0E+3  -> 1
253samq0922 samequantum  -0E+3     7E-3  -> 0
254samq0923 samequantum  -0E+3     7     -> 0
255samq0924 samequantum  -0E+3     7E+3  -> 1
256samq0925 samequantum  -0E+3     sNaN  -> 0
257
258samq1110 samequantum  0E-3    -Inf   -> 0
259samq1111 samequantum  0E-3     Inf   -> 0
260samq1112 samequantum  0E-3     NaN   -> 0
261samq1113 samequantum  0E-3    -7E+3  -> 0
262samq1114 samequantum  0E-3    -7     -> 0
263samq1115 samequantum  0E-3    -7E-3  -> 1
264samq1116 samequantum  0E-3    -0E-3  -> 1
265samq1117 samequantum  0E-3    -0     -> 0
266samq1118 samequantum  0E-3    -0E+3  -> 0
267samq1119 samequantum  0E-3     0E-3  -> 1
268samq1120 samequantum  0E-3     0     -> 0
269samq1121 samequantum  0E-3     0E+3  -> 0
270samq1122 samequantum  0E-3     7E-3  -> 1
271samq1123 samequantum  0E-3     7     -> 0
272samq1124 samequantum  0E-3     7E+3  -> 0
273samq1125 samequantum  0E-3     sNaN  -> 0
274
275samq1210 samequantum  0       -Inf   -> 0
276samq1211 samequantum  0        Inf   -> 0
277samq1212 samequantum  0        NaN   -> 0
278samq1213 samequantum  0       -7E+3  -> 0
279samq1214 samequantum  0       -7     -> 1
280samq1215 samequantum  0       -7E-3  -> 0
281samq1216 samequantum  0       -0E-3  -> 0
282samq1217 samequantum  0       -0     -> 1
283samq1218 samequantum  0       -0E+3  -> 0
284samq1219 samequantum  0        0E-3  -> 0
285samq1220 samequantum  0        0     -> 1
286samq1221 samequantum  0        0E+3  -> 0
287samq1222 samequantum  0        7E-3  -> 0
288samq1223 samequantum  0        7     -> 1
289samq1224 samequantum  0        7E+3  -> 0
290samq1225 samequantum  0        sNaN  -> 0
291
292samq1310 samequantum  0E+3    -Inf   -> 0
293samq1311 samequantum  0E+3     Inf   -> 0
294samq1312 samequantum  0E+3     NaN   -> 0
295samq1313 samequantum  0E+3    -7E+3  -> 1
296samq1314 samequantum  0E+3    -7     -> 0
297samq1315 samequantum  0E+3    -7E-3  -> 0
298samq1316 samequantum  0E+3    -0E-3  -> 0
299samq1317 samequantum  0E+3    -0     -> 0
300samq1318 samequantum  0E+3    -0E+3  -> 1
301samq1319 samequantum  0E+3     0E-3  -> 0
302samq1320 samequantum  0E+3     0     -> 0
303samq1321 samequantum  0E+3     0E+3  -> 1
304samq1322 samequantum  0E+3     7E-3  -> 0
305samq1323 samequantum  0E+3     7     -> 0
306samq1324 samequantum  0E+3     7E+3  -> 1
307samq1325 samequantum  0E+3     sNaN  -> 0
308
309samq1410 samequantum  7E-3    -Inf   -> 0
310samq1411 samequantum  7E-3     Inf   -> 0
311samq1412 samequantum  7E-3     NaN   -> 0
312samq1413 samequantum  7E-3    -7E+3  -> 0
313samq1414 samequantum  7E-3    -7     -> 0
314samq1415 samequantum  7E-3    -7E-3  -> 1
315samq1416 samequantum  7E-3    -0E-3  -> 1
316samq1417 samequantum  7E-3    -0     -> 0
317samq1418 samequantum  7E-3    -0E+3  -> 0
318samq1419 samequantum  7E-3     0E-3  -> 1
319samq1420 samequantum  7E-3     0     -> 0
320samq1421 samequantum  7E-3     0E+3  -> 0
321samq1422 samequantum  7E-3     7E-3  -> 1
322samq1423 samequantum  7E-3     7     -> 0
323samq1424 samequantum  7E-3     7E+3  -> 0
324samq1425 samequantum  7E-3     sNaN  -> 0
325
326samq1510 samequantum  7      -Inf   -> 0
327samq1511 samequantum  7       Inf   -> 0
328samq1512 samequantum  7       NaN   -> 0
329samq1513 samequantum  7      -7E+3  -> 0
330samq1514 samequantum  7      -7     -> 1
331samq1515 samequantum  7      -7E-3  -> 0
332samq1516 samequantum  7      -0E-3  -> 0
333samq1517 samequantum  7      -0     -> 1
334samq1518 samequantum  7      -0E+3  -> 0
335samq1519 samequantum  7       0E-3  -> 0
336samq1520 samequantum  7       0     -> 1
337samq1521 samequantum  7       0E+3  -> 0
338samq1522 samequantum  7       7E-3  -> 0
339samq1523 samequantum  7       7     -> 1
340samq1524 samequantum  7       7E+3  -> 0
341samq1525 samequantum  7       sNaN  -> 0
342
343samq1610 samequantum  7E+3    -Inf   -> 0
344samq1611 samequantum  7E+3     Inf   -> 0
345samq1612 samequantum  7E+3     NaN   -> 0
346samq1613 samequantum  7E+3    -7E+3  -> 1
347samq1614 samequantum  7E+3    -7     -> 0
348samq1615 samequantum  7E+3    -7E-3  -> 0
349samq1616 samequantum  7E+3    -0E-3  -> 0
350samq1617 samequantum  7E+3    -0     -> 0
351samq1618 samequantum  7E+3    -0E+3  -> 1
352samq1619 samequantum  7E+3     0E-3  -> 0
353samq1620 samequantum  7E+3     0     -> 0
354samq1621 samequantum  7E+3     0E+3  -> 1
355samq1622 samequantum  7E+3     7E-3  -> 0
356samq1623 samequantum  7E+3     7     -> 0
357samq1624 samequantum  7E+3     7E+3  -> 1
358samq1625 samequantum  7E+3     sNaN  -> 0
359
360samq1710 samequantum  sNaN    -Inf   -> 0
361samq1711 samequantum  sNaN     Inf   -> 0
362samq1712 samequantum  sNaN     NaN   -> 1
363samq1713 samequantum  sNaN    -7E+3  -> 0
364samq1714 samequantum  sNaN    -7     -> 0
365samq1715 samequantum  sNaN    -7E-3  -> 0
366samq1716 samequantum  sNaN    -0E-3  -> 0
367samq1717 samequantum  sNaN    -0     -> 0
368samq1718 samequantum  sNaN    -0E+3  -> 0
369samq1719 samequantum  sNaN     0E-3  -> 0
370samq1720 samequantum  sNaN     0     -> 0
371samq1721 samequantum  sNaN     0E+3  -> 0
372samq1722 samequantum  sNaN     7E-3  -> 0
373samq1723 samequantum  sNaN     7     -> 0
374samq1724 samequantum  sNaN     7E+3  -> 0
375samq1725 samequantum  sNaN     sNaN  -> 1
376-- noisy NaNs
377samq1730 samequantum  sNaN3    sNaN3 -> 1
378samq1731 samequantum  sNaN3    sNaN4 -> 1
379samq1732 samequantum   NaN3     NaN3 -> 1
380samq1733 samequantum   NaN3     NaN4 -> 1
381samq1734 samequantum  sNaN3     3    -> 0
382samq1735 samequantum   NaN3     3    -> 0
383samq1736 samequantum      4    sNaN4 -> 0
384samq1737 samequantum      3     NaN3 -> 0
385samq1738 samequantum    Inf    sNaN4 -> 0
386samq1739 samequantum   -Inf     NaN3 -> 0
387
388
389
390