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