1------------------------------------------------------------------------
2-- ddOr.decTest -- digitwise logical OR for decDoubles                --
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
22precision:   16
23maxExponent: 384
24minExponent: -383
25extended:    1
26clamp:       1
27rounding:    half_even
28
29-- Sanity check (truth table)
30ddor001 or             0    0 ->    0
31ddor002 or             0    1 ->    1
32ddor003 or             1    0 ->    1
33ddor004 or             1    1 ->    1
34ddor005 or          1100 1010 -> 1110
35-- and at msd and msd-1
36ddor006 or 0000000000000000 0000000000000000 ->           0
37ddor007 or 0000000000000000 1000000000000000 ->   1000000000000000
38ddor008 or 1000000000000000 0000000000000000 ->   1000000000000000
39ddor009 or 1000000000000000 1000000000000000 ->   1000000000000000
40ddor010 or 0000000000000000 0000000000000000 ->           0
41ddor011 or 0000000000000000 0100000000000000 ->    100000000000000
42ddor012 or 0100000000000000 0000000000000000 ->    100000000000000
43ddor013 or 0100000000000000 0100000000000000 ->    100000000000000
44
45-- Various lengths
46--         1234567890123456     1234567890123456 1234567890123456
47ddor020 or 1111111111111111     1111111111111111  ->  1111111111111111
48ddor021 or  111111111111111      111111111111111  ->   111111111111111
49ddor022 or   11111111111111       11111111111111  ->    11111111111111
50ddor023 or    1111111111111        1111111111111  ->     1111111111111
51ddor024 or     111111111111         111111111111  ->      111111111111
52ddor025 or      11111111111          11111111111  ->       11111111111
53ddor026 or       1111111111           1111111111  ->        1111111111
54ddor027 or        111111111            111111111  ->         111111111
55ddor028 or         11111111             11111111  ->          11111111
56ddor029 or          1111111              1111111  ->           1111111
57ddor030 or           111111               111111  ->            111111
58ddor031 or            11111                11111  ->             11111
59ddor032 or             1111                 1111  ->              1111
60ddor033 or              111                  111  ->               111
61ddor034 or               11                   11  ->                11
62ddor035 or                1                    1  ->                 1
63ddor036 or                0                    0  ->                 0
64
65ddor042 or  111111110000000     1111111110000000  ->  1111111110000000
66ddor043 or   11111110000000     1000000100000000  ->  1011111110000000
67ddor044 or    1111110000000     1000001000000000  ->  1001111110000000
68ddor045 or     111110000000     1000010000000000  ->  1000111110000000
69ddor046 or      11110000000     1000100000000000  ->  1000111110000000
70ddor047 or       1110000000     1001000000000000  ->  1001001110000000
71ddor048 or        110000000     1010000000000000  ->  1010000110000000
72ddor049 or         10000000     1100000000000000  ->  1100000010000000
73
74ddor090 or 011111111  111101111  ->  111111111
75ddor091 or 101111111  111101111  ->  111111111
76ddor092 or 110111111  111101111  ->  111111111
77ddor093 or 111011111  111101111  ->  111111111
78ddor094 or 111101111  111101111  ->  111101111
79ddor095 or 111110111  111101111  ->  111111111
80ddor096 or 111111011  111101111  ->  111111111
81ddor097 or 111111101  111101111  ->  111111111
82ddor098 or 111111110  111101111  ->  111111111
83
84ddor100 or 111101111  011111111  ->  111111111
85ddor101 or 111101111  101111111  ->  111111111
86ddor102 or 111101111  110111111  ->  111111111
87ddor103 or 111101111  111011111  ->  111111111
88ddor104 or 111101111  111101111  ->  111101111
89ddor105 or 111101111  111110111  ->  111111111
90ddor106 or 111101111  111111011  ->  111111111
91ddor107 or 111101111  111111101  ->  111111111
92ddor108 or 111101111  111111110  ->  111111111
93
94-- non-0/1 should not be accepted, nor should signs
95ddor220 or 111111112  111111111  ->  NaN Invalid_operation
96ddor221 or 333333333  333333333  ->  NaN Invalid_operation
97ddor222 or 555555555  555555555  ->  NaN Invalid_operation
98ddor223 or 777777777  777777777  ->  NaN Invalid_operation
99ddor224 or 999999999  999999999  ->  NaN Invalid_operation
100ddor225 or 222222222  999999999  ->  NaN Invalid_operation
101ddor226 or 444444444  999999999  ->  NaN Invalid_operation
102ddor227 or 666666666  999999999  ->  NaN Invalid_operation
103ddor228 or 888888888  999999999  ->  NaN Invalid_operation
104ddor229 or 999999999  222222222  ->  NaN Invalid_operation
105ddor230 or 999999999  444444444  ->  NaN Invalid_operation
106ddor231 or 999999999  666666666  ->  NaN Invalid_operation
107ddor232 or 999999999  888888888  ->  NaN Invalid_operation
108-- a few randoms
109ddor240 or  567468689 -934981942 ->  NaN Invalid_operation
110ddor241 or  567367689  934981942 ->  NaN Invalid_operation
111ddor242 or -631917772 -706014634 ->  NaN Invalid_operation
112ddor243 or -756253257  138579234 ->  NaN Invalid_operation
113ddor244 or  835590149  567435400 ->  NaN Invalid_operation
114-- test MSD
115ddor250 or  2000000000000000 1000000000000000 ->  NaN Invalid_operation
116ddor251 or  7000000000000000 1000000000000000 ->  NaN Invalid_operation
117ddor252 or  8000000000000000 1000000000000000 ->  NaN Invalid_operation
118ddor253 or  9000000000000000 1000000000000000 ->  NaN Invalid_operation
119ddor254 or  2000000000000000 0000000000000000 ->  NaN Invalid_operation
120ddor255 or  7000000000000000 0000000000000000 ->  NaN Invalid_operation
121ddor256 or  8000000000000000 0000000000000000 ->  NaN Invalid_operation
122ddor257 or  9000000000000000 0000000000000000 ->  NaN Invalid_operation
123ddor258 or  1000000000000000 2000000000000000 ->  NaN Invalid_operation
124ddor259 or  1000000000000000 7000000000000000 ->  NaN Invalid_operation
125ddor260 or  1000000000000000 8000000000000000 ->  NaN Invalid_operation
126ddor261 or  1000000000000000 9000000000000000 ->  NaN Invalid_operation
127ddor262 or  0000000000000000 2000000000000000 ->  NaN Invalid_operation
128ddor263 or  0000000000000000 7000000000000000 ->  NaN Invalid_operation
129ddor264 or  0000000000000000 8000000000000000 ->  NaN Invalid_operation
130ddor265 or  0000000000000000 9000000000000000 ->  NaN Invalid_operation
131-- test MSD-1
132ddor270 or  0200001000000000 1000100000000010 ->  NaN Invalid_operation
133ddor271 or  0700000100000000 1000010000000100 ->  NaN Invalid_operation
134ddor272 or  0800000010000000 1000001000001000 ->  NaN Invalid_operation
135ddor273 or  0900000001000000 1000000100010000 ->  NaN Invalid_operation
136ddor274 or  1000000000100000 0200000010100000 ->  NaN Invalid_operation
137ddor275 or  1000000000010000 0700000001000000 ->  NaN Invalid_operation
138ddor276 or  1000000000001000 0800000010100000 ->  NaN Invalid_operation
139ddor277 or  1000000000000100 0900000000010000 ->  NaN Invalid_operation
140-- test LSD
141ddor280 or  0010000000000002 1000000100000001 ->  NaN Invalid_operation
142ddor281 or  0001000000000007 1000001000000011 ->  NaN Invalid_operation
143ddor282 or  0000100000000008 1000010000000001 ->  NaN Invalid_operation
144ddor283 or  0000010000000009 1000100000000001 ->  NaN Invalid_operation
145ddor284 or  1000001000000000 0001000000000002 ->  NaN Invalid_operation
146ddor285 or  1000000100000000 0010000000000007 ->  NaN Invalid_operation
147ddor286 or  1000000010000000 0100000000000008 ->  NaN Invalid_operation
148ddor287 or  1000000001000000 1000000000000009 ->  NaN Invalid_operation
149-- test Middie
150ddor288 or  0010000020000000 1000001000000000 ->  NaN Invalid_operation
151ddor289 or  0001000070000001 1000000100000000 ->  NaN Invalid_operation
152ddor290 or  0000100080000010 1000000010000000 ->  NaN Invalid_operation
153ddor291 or  0000010090000100 1000000001000000 ->  NaN Invalid_operation
154ddor292 or  1000001000001000 0000000020100000 ->  NaN Invalid_operation
155ddor293 or  1000000100010000 0000000070010000 ->  NaN Invalid_operation
156ddor294 or  1000000010100000 0000000080001000 ->  NaN Invalid_operation
157ddor295 or  1000000001000000 0000000090000100 ->  NaN Invalid_operation
158-- signs
159ddor296 or -1000000001000000 -0000010000000100 ->  NaN Invalid_operation
160ddor297 or -1000000001000000  0000000010000100 ->  NaN Invalid_operation
161ddor298 or  1000000001000000 -0000001000000100 ->  NaN Invalid_operation
162ddor299 or  1000000001000000  0000000011000100 ->  1000000011000100
163
164-- Nmax, Nmin, Ntiny-like
165ddor331 or  2   9.99999999E+199     -> NaN Invalid_operation
166ddor332 or  3   1E-199              -> NaN Invalid_operation
167ddor333 or  4   1.00000000E-199     -> NaN Invalid_operation
168ddor334 or  5   1E-100              -> NaN Invalid_operation
169ddor335 or  6   -1E-100             -> NaN Invalid_operation
170ddor336 or  7   -1.00000000E-199    -> NaN Invalid_operation
171ddor337 or  8   -1E-199             -> NaN Invalid_operation
172ddor338 or  9   -9.99999999E+199    -> NaN Invalid_operation
173ddor341 or  9.99999999E+299     -18 -> NaN Invalid_operation
174ddor342 or  1E-299               01 -> NaN Invalid_operation
175ddor343 or  1.00000000E-299     -18 -> NaN Invalid_operation
176ddor344 or  1E-100               18 -> NaN Invalid_operation
177ddor345 or  -1E-100             -10 -> NaN Invalid_operation
178ddor346 or  -1.00000000E-299     18 -> NaN Invalid_operation
179ddor347 or  -1E-299              10 -> NaN Invalid_operation
180ddor348 or  -9.99999999E+299    -18 -> NaN Invalid_operation
181
182-- A few other non-integers
183ddor361 or  1.0                  1  -> NaN Invalid_operation
184ddor362 or  1E+1                 1  -> NaN Invalid_operation
185ddor363 or  0.0                  1  -> NaN Invalid_operation
186ddor364 or  0E+1                 1  -> NaN Invalid_operation
187ddor365 or  9.9                  1  -> NaN Invalid_operation
188ddor366 or  9E+1                 1  -> NaN Invalid_operation
189ddor371 or  0 1.0                   -> NaN Invalid_operation
190ddor372 or  0 1E+1                  -> NaN Invalid_operation
191ddor373 or  0 0.0                   -> NaN Invalid_operation
192ddor374 or  0 0E+1                  -> NaN Invalid_operation
193ddor375 or  0 9.9                   -> NaN Invalid_operation
194ddor376 or  0 9E+1                  -> NaN Invalid_operation
195
196-- All Specials are in error
197ddor780 or -Inf  -Inf   -> NaN Invalid_operation
198ddor781 or -Inf  -1000  -> NaN Invalid_operation
199ddor782 or -Inf  -1     -> NaN Invalid_operation
200ddor783 or -Inf  -0     -> NaN Invalid_operation
201ddor784 or -Inf   0     -> NaN Invalid_operation
202ddor785 or -Inf   1     -> NaN Invalid_operation
203ddor786 or -Inf   1000  -> NaN Invalid_operation
204ddor787 or -1000 -Inf   -> NaN Invalid_operation
205ddor788 or -Inf  -Inf   -> NaN Invalid_operation
206ddor789 or -1    -Inf   -> NaN Invalid_operation
207ddor790 or -0    -Inf   -> NaN Invalid_operation
208ddor791 or  0    -Inf   -> NaN Invalid_operation
209ddor792 or  1    -Inf   -> NaN Invalid_operation
210ddor793 or  1000 -Inf   -> NaN Invalid_operation
211ddor794 or  Inf  -Inf   -> NaN Invalid_operation
212
213ddor800 or  Inf  -Inf   -> NaN Invalid_operation
214ddor801 or  Inf  -1000  -> NaN Invalid_operation
215ddor802 or  Inf  -1     -> NaN Invalid_operation
216ddor803 or  Inf  -0     -> NaN Invalid_operation
217ddor804 or  Inf   0     -> NaN Invalid_operation
218ddor805 or  Inf   1     -> NaN Invalid_operation
219ddor806 or  Inf   1000  -> NaN Invalid_operation
220ddor807 or  Inf   Inf   -> NaN Invalid_operation
221ddor808 or -1000  Inf   -> NaN Invalid_operation
222ddor809 or -Inf   Inf   -> NaN Invalid_operation
223ddor810 or -1     Inf   -> NaN Invalid_operation
224ddor811 or -0     Inf   -> NaN Invalid_operation
225ddor812 or  0     Inf   -> NaN Invalid_operation
226ddor813 or  1     Inf   -> NaN Invalid_operation
227ddor814 or  1000  Inf   -> NaN Invalid_operation
228ddor815 or  Inf   Inf   -> NaN Invalid_operation
229
230ddor821 or  NaN -Inf    -> NaN Invalid_operation
231ddor822 or  NaN -1000   -> NaN Invalid_operation
232ddor823 or  NaN -1      -> NaN Invalid_operation
233ddor824 or  NaN -0      -> NaN Invalid_operation
234ddor825 or  NaN  0      -> NaN Invalid_operation
235ddor826 or  NaN  1      -> NaN Invalid_operation
236ddor827 or  NaN  1000   -> NaN Invalid_operation
237ddor828 or  NaN  Inf    -> NaN Invalid_operation
238ddor829 or  NaN  NaN    -> NaN Invalid_operation
239ddor830 or -Inf  NaN    -> NaN Invalid_operation
240ddor831 or -1000 NaN    -> NaN Invalid_operation
241ddor832 or -1    NaN    -> NaN Invalid_operation
242ddor833 or -0    NaN    -> NaN Invalid_operation
243ddor834 or  0    NaN    -> NaN Invalid_operation
244ddor835 or  1    NaN    -> NaN Invalid_operation
245ddor836 or  1000 NaN    -> NaN Invalid_operation
246ddor837 or  Inf  NaN    -> NaN Invalid_operation
247
248ddor841 or  sNaN -Inf   ->  NaN  Invalid_operation
249ddor842 or  sNaN -1000  ->  NaN  Invalid_operation
250ddor843 or  sNaN -1     ->  NaN  Invalid_operation
251ddor844 or  sNaN -0     ->  NaN  Invalid_operation
252ddor845 or  sNaN  0     ->  NaN  Invalid_operation
253ddor846 or  sNaN  1     ->  NaN  Invalid_operation
254ddor847 or  sNaN  1000  ->  NaN  Invalid_operation
255ddor848 or  sNaN  NaN   ->  NaN  Invalid_operation
256ddor849 or  sNaN sNaN   ->  NaN  Invalid_operation
257ddor850 or  NaN  sNaN   ->  NaN  Invalid_operation
258ddor851 or -Inf  sNaN   ->  NaN  Invalid_operation
259ddor852 or -1000 sNaN   ->  NaN  Invalid_operation
260ddor853 or -1    sNaN   ->  NaN  Invalid_operation
261ddor854 or -0    sNaN   ->  NaN  Invalid_operation
262ddor855 or  0    sNaN   ->  NaN  Invalid_operation
263ddor856 or  1    sNaN   ->  NaN  Invalid_operation
264ddor857 or  1000 sNaN   ->  NaN  Invalid_operation
265ddor858 or  Inf  sNaN   ->  NaN  Invalid_operation
266ddor859 or  NaN  sNaN   ->  NaN  Invalid_operation
267
268-- propagating NaNs
269ddor861 or  NaN1   -Inf    -> NaN Invalid_operation
270ddor862 or +NaN2   -1000   -> NaN Invalid_operation
271ddor863 or  NaN3    1000   -> NaN Invalid_operation
272ddor864 or  NaN4    Inf    -> NaN Invalid_operation
273ddor865 or  NaN5   +NaN6   -> NaN Invalid_operation
274ddor866 or -Inf     NaN7   -> NaN Invalid_operation
275ddor867 or -1000    NaN8   -> NaN Invalid_operation
276ddor868 or  1000    NaN9   -> NaN Invalid_operation
277ddor869 or  Inf    +NaN10  -> NaN Invalid_operation
278ddor871 or  sNaN11  -Inf   -> NaN Invalid_operation
279ddor872 or  sNaN12  -1000  -> NaN Invalid_operation
280ddor873 or  sNaN13   1000  -> NaN Invalid_operation
281ddor874 or  sNaN14   NaN17 -> NaN Invalid_operation
282ddor875 or  sNaN15  sNaN18 -> NaN Invalid_operation
283ddor876 or  NaN16   sNaN19 -> NaN Invalid_operation
284ddor877 or -Inf    +sNaN20 -> NaN Invalid_operation
285ddor878 or -1000    sNaN21 -> NaN Invalid_operation
286ddor879 or  1000    sNaN22 -> NaN Invalid_operation
287ddor880 or  Inf     sNaN23 -> NaN Invalid_operation
288ddor881 or +NaN25  +sNaN24 -> NaN Invalid_operation
289ddor882 or -NaN26    NaN28 -> NaN Invalid_operation
290ddor883 or -sNaN27  sNaN29 -> NaN Invalid_operation
291ddor884 or  1000    -NaN30 -> NaN Invalid_operation
292ddor885 or  1000   -sNaN31 -> NaN Invalid_operation
293