ddOr.decTest 15 KB

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