samequantum.decTest 16 KB

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