dqSubtract.decTest 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. ------------------------------------------------------------------------
  2. -- dqSubtract.decTest -- decQuad subtraction --
  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. -- This set of tests are for decQuads only; all arguments are
  22. -- representable in a decQuad
  23. extended: 1
  24. clamp: 1
  25. precision: 34
  26. maxExponent: 6144
  27. minExponent: -6143
  28. rounding: half_even
  29. -- [first group are 'quick confidence check']
  30. dqsub001 subtract 0 0 -> '0'
  31. dqsub002 subtract 1 1 -> '0'
  32. dqsub003 subtract 1 2 -> '-1'
  33. dqsub004 subtract 2 1 -> '1'
  34. dqsub005 subtract 2 2 -> '0'
  35. dqsub006 subtract 3 2 -> '1'
  36. dqsub007 subtract 2 3 -> '-1'
  37. dqsub011 subtract -0 0 -> '-0'
  38. dqsub012 subtract -1 1 -> '-2'
  39. dqsub013 subtract -1 2 -> '-3'
  40. dqsub014 subtract -2 1 -> '-3'
  41. dqsub015 subtract -2 2 -> '-4'
  42. dqsub016 subtract -3 2 -> '-5'
  43. dqsub017 subtract -2 3 -> '-5'
  44. dqsub021 subtract 0 -0 -> '0'
  45. dqsub022 subtract 1 -1 -> '2'
  46. dqsub023 subtract 1 -2 -> '3'
  47. dqsub024 subtract 2 -1 -> '3'
  48. dqsub025 subtract 2 -2 -> '4'
  49. dqsub026 subtract 3 -2 -> '5'
  50. dqsub027 subtract 2 -3 -> '5'
  51. dqsub030 subtract 11 1 -> 10
  52. dqsub031 subtract 10 1 -> 9
  53. dqsub032 subtract 9 1 -> 8
  54. dqsub033 subtract 1 1 -> 0
  55. dqsub034 subtract 0 1 -> -1
  56. dqsub035 subtract -1 1 -> -2
  57. dqsub036 subtract -9 1 -> -10
  58. dqsub037 subtract -10 1 -> -11
  59. dqsub038 subtract -11 1 -> -12
  60. dqsub040 subtract '5.75' '3.3' -> '2.45'
  61. dqsub041 subtract '5' '-3' -> '8'
  62. dqsub042 subtract '-5' '-3' -> '-2'
  63. dqsub043 subtract '-7' '2.5' -> '-9.5'
  64. dqsub044 subtract '0.7' '0.3' -> '0.4'
  65. dqsub045 subtract '1.3' '0.3' -> '1.0'
  66. dqsub046 subtract '1.25' '1.25' -> '0.00'
  67. dqsub050 subtract '1.23456789' '1.00000000' -> '0.23456789'
  68. dqsub051 subtract '1.23456789' '1.00000089' -> '0.23456700'
  69. dqsub060 subtract '70' '10000e+34' -> '-1.000000000000000000000000000000000E+38' Inexact Rounded
  70. dqsub061 subtract '700' '10000e+34' -> '-1.000000000000000000000000000000000E+38' Inexact Rounded
  71. dqsub062 subtract '7000' '10000e+34' -> '-9.999999999999999999999999999999999E+37' Inexact Rounded
  72. dqsub063 subtract '70000' '10000e+34' -> '-9.999999999999999999999999999999993E+37' Rounded
  73. dqsub064 subtract '700000' '10000e+34' -> '-9.999999999999999999999999999999930E+37' Rounded
  74. -- symmetry:
  75. dqsub065 subtract '10000e+34' '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
  76. dqsub066 subtract '10000e+34' '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
  77. dqsub067 subtract '10000e+34' '7000' -> '9.999999999999999999999999999999999E+37' Inexact Rounded
  78. dqsub068 subtract '10000e+34' '70000' -> '9.999999999999999999999999999999993E+37' Rounded
  79. dqsub069 subtract '10000e+34' '700000' -> '9.999999999999999999999999999999930E+37' Rounded
  80. -- some of the next group are really constructor tests
  81. dqsub090 subtract '00.0' '0.0' -> '0.0'
  82. dqsub091 subtract '00.0' '0.00' -> '0.00'
  83. dqsub092 subtract '0.00' '00.0' -> '0.00'
  84. dqsub093 subtract '00.0' '0.00' -> '0.00'
  85. dqsub094 subtract '0.00' '00.0' -> '0.00'
  86. dqsub095 subtract '3' '.3' -> '2.7'
  87. dqsub096 subtract '3.' '.3' -> '2.7'
  88. dqsub097 subtract '3.0' '.3' -> '2.7'
  89. dqsub098 subtract '3.00' '.3' -> '2.70'
  90. dqsub099 subtract '3' '3' -> '0'
  91. dqsub100 subtract '3' '+3' -> '0'
  92. dqsub101 subtract '3' '-3' -> '6'
  93. dqsub102 subtract '3' '0.3' -> '2.7'
  94. dqsub103 subtract '3.' '0.3' -> '2.7'
  95. dqsub104 subtract '3.0' '0.3' -> '2.7'
  96. dqsub105 subtract '3.00' '0.3' -> '2.70'
  97. dqsub106 subtract '3' '3.0' -> '0.0'
  98. dqsub107 subtract '3' '+3.0' -> '0.0'
  99. dqsub108 subtract '3' '-3.0' -> '6.0'
  100. -- the above all from add; massaged and extended. Now some new ones...
  101. -- [particularly important for comparisons]
  102. -- NB: -xE-8 below were non-exponents pre-ANSI X3-274, and -1E-7 or 0E-7
  103. -- with input rounding.
  104. dqsub120 subtract '10.23456784' '10.23456789' -> '-5E-8'
  105. dqsub121 subtract '10.23456785' '10.23456789' -> '-4E-8'
  106. dqsub122 subtract '10.23456786' '10.23456789' -> '-3E-8'
  107. dqsub123 subtract '10.23456787' '10.23456789' -> '-2E-8'
  108. dqsub124 subtract '10.23456788' '10.23456789' -> '-1E-8'
  109. dqsub125 subtract '10.23456789' '10.23456789' -> '0E-8'
  110. dqsub126 subtract '10.23456790' '10.23456789' -> '1E-8'
  111. dqsub127 subtract '10.23456791' '10.23456789' -> '2E-8'
  112. dqsub128 subtract '10.23456792' '10.23456789' -> '3E-8'
  113. dqsub129 subtract '10.23456793' '10.23456789' -> '4E-8'
  114. dqsub130 subtract '10.23456794' '10.23456789' -> '5E-8'
  115. dqsub131 subtract '10.23456781' '10.23456786' -> '-5E-8'
  116. dqsub132 subtract '10.23456782' '10.23456786' -> '-4E-8'
  117. dqsub133 subtract '10.23456783' '10.23456786' -> '-3E-8'
  118. dqsub134 subtract '10.23456784' '10.23456786' -> '-2E-8'
  119. dqsub135 subtract '10.23456785' '10.23456786' -> '-1E-8'
  120. dqsub136 subtract '10.23456786' '10.23456786' -> '0E-8'
  121. dqsub137 subtract '10.23456787' '10.23456786' -> '1E-8'
  122. dqsub138 subtract '10.23456788' '10.23456786' -> '2E-8'
  123. dqsub139 subtract '10.23456789' '10.23456786' -> '3E-8'
  124. dqsub140 subtract '10.23456790' '10.23456786' -> '4E-8'
  125. dqsub141 subtract '10.23456791' '10.23456786' -> '5E-8'
  126. dqsub142 subtract '1' '0.999999999' -> '1E-9'
  127. dqsub143 subtract '0.999999999' '1' -> '-1E-9'
  128. dqsub144 subtract '-10.23456780' '-10.23456786' -> '6E-8'
  129. dqsub145 subtract '-10.23456790' '-10.23456786' -> '-4E-8'
  130. dqsub146 subtract '-10.23456791' '-10.23456786' -> '-5E-8'
  131. -- additional scaled arithmetic tests [0.97 problem]
  132. dqsub160 subtract '0' '.1' -> '-0.1'
  133. dqsub161 subtract '00' '.97983' -> '-0.97983'
  134. dqsub162 subtract '0' '.9' -> '-0.9'
  135. dqsub163 subtract '0' '0.102' -> '-0.102'
  136. dqsub164 subtract '0' '.4' -> '-0.4'
  137. dqsub165 subtract '0' '.307' -> '-0.307'
  138. dqsub166 subtract '0' '.43822' -> '-0.43822'
  139. dqsub167 subtract '0' '.911' -> '-0.911'
  140. dqsub168 subtract '.0' '.02' -> '-0.02'
  141. dqsub169 subtract '00' '.392' -> '-0.392'
  142. dqsub170 subtract '0' '.26' -> '-0.26'
  143. dqsub171 subtract '0' '0.51' -> '-0.51'
  144. dqsub172 subtract '0' '.2234' -> '-0.2234'
  145. dqsub173 subtract '0' '.2' -> '-0.2'
  146. dqsub174 subtract '.0' '.0008' -> '-0.0008'
  147. -- 0. on left
  148. dqsub180 subtract '0.0' '-.1' -> '0.1'
  149. dqsub181 subtract '0.00' '-.97983' -> '0.97983'
  150. dqsub182 subtract '0.0' '-.9' -> '0.9'
  151. dqsub183 subtract '0.0' '-0.102' -> '0.102'
  152. dqsub184 subtract '0.0' '-.4' -> '0.4'
  153. dqsub185 subtract '0.0' '-.307' -> '0.307'
  154. dqsub186 subtract '0.0' '-.43822' -> '0.43822'
  155. dqsub187 subtract '0.0' '-.911' -> '0.911'
  156. dqsub188 subtract '0.0' '-.02' -> '0.02'
  157. dqsub189 subtract '0.00' '-.392' -> '0.392'
  158. dqsub190 subtract '0.0' '-.26' -> '0.26'
  159. dqsub191 subtract '0.0' '-0.51' -> '0.51'
  160. dqsub192 subtract '0.0' '-.2234' -> '0.2234'
  161. dqsub193 subtract '0.0' '-.2' -> '0.2'
  162. dqsub194 subtract '0.0' '-.0008' -> '0.0008'
  163. -- negatives of same
  164. dqsub200 subtract '0' '-.1' -> '0.1'
  165. dqsub201 subtract '00' '-.97983' -> '0.97983'
  166. dqsub202 subtract '0' '-.9' -> '0.9'
  167. dqsub203 subtract '0' '-0.102' -> '0.102'
  168. dqsub204 subtract '0' '-.4' -> '0.4'
  169. dqsub205 subtract '0' '-.307' -> '0.307'
  170. dqsub206 subtract '0' '-.43822' -> '0.43822'
  171. dqsub207 subtract '0' '-.911' -> '0.911'
  172. dqsub208 subtract '.0' '-.02' -> '0.02'
  173. dqsub209 subtract '00' '-.392' -> '0.392'
  174. dqsub210 subtract '0' '-.26' -> '0.26'
  175. dqsub211 subtract '0' '-0.51' -> '0.51'
  176. dqsub212 subtract '0' '-.2234' -> '0.2234'
  177. dqsub213 subtract '0' '-.2' -> '0.2'
  178. dqsub214 subtract '.0' '-.0008' -> '0.0008'
  179. -- more fixed, LHS swaps [really the same as testcases under add]
  180. dqsub220 subtract '-56267E-12' 0 -> '-5.6267E-8'
  181. dqsub221 subtract '-56267E-11' 0 -> '-5.6267E-7'
  182. dqsub222 subtract '-56267E-10' 0 -> '-0.0000056267'
  183. dqsub223 subtract '-56267E-9' 0 -> '-0.000056267'
  184. dqsub224 subtract '-56267E-8' 0 -> '-0.00056267'
  185. dqsub225 subtract '-56267E-7' 0 -> '-0.0056267'
  186. dqsub226 subtract '-56267E-6' 0 -> '-0.056267'
  187. dqsub227 subtract '-56267E-5' 0 -> '-0.56267'
  188. dqsub228 subtract '-56267E-2' 0 -> '-562.67'
  189. dqsub229 subtract '-56267E-1' 0 -> '-5626.7'
  190. dqsub230 subtract '-56267E-0' 0 -> '-56267'
  191. -- symmetry ...
  192. dqsub240 subtract 0 '-56267E-12' -> '5.6267E-8'
  193. dqsub241 subtract 0 '-56267E-11' -> '5.6267E-7'
  194. dqsub242 subtract 0 '-56267E-10' -> '0.0000056267'
  195. dqsub243 subtract 0 '-56267E-9' -> '0.000056267'
  196. dqsub244 subtract 0 '-56267E-8' -> '0.00056267'
  197. dqsub245 subtract 0 '-56267E-7' -> '0.0056267'
  198. dqsub246 subtract 0 '-56267E-6' -> '0.056267'
  199. dqsub247 subtract 0 '-56267E-5' -> '0.56267'
  200. dqsub248 subtract 0 '-56267E-2' -> '562.67'
  201. dqsub249 subtract 0 '-56267E-1' -> '5626.7'
  202. dqsub250 subtract 0 '-56267E-0' -> '56267'
  203. -- now some more from the 'new' add
  204. dqsub301 subtract '1.23456789' '1.00000000' -> '0.23456789'
  205. dqsub302 subtract '1.23456789' '1.00000011' -> '0.23456778'
  206. -- some carrying effects
  207. dqsub321 subtract '0.9998' '0.0000' -> '0.9998'
  208. dqsub322 subtract '0.9998' '0.0001' -> '0.9997'
  209. dqsub323 subtract '0.9998' '0.0002' -> '0.9996'
  210. dqsub324 subtract '0.9998' '0.0003' -> '0.9995'
  211. dqsub325 subtract '0.9998' '-0.0000' -> '0.9998'
  212. dqsub326 subtract '0.9998' '-0.0001' -> '0.9999'
  213. dqsub327 subtract '0.9998' '-0.0002' -> '1.0000'
  214. dqsub328 subtract '0.9998' '-0.0003' -> '1.0001'
  215. -- internal boundaries
  216. dqsub346 subtract '10000e+9' '7' -> '9999999999993'
  217. dqsub347 subtract '10000e+9' '70' -> '9999999999930'
  218. dqsub348 subtract '10000e+9' '700' -> '9999999999300'
  219. dqsub349 subtract '10000e+9' '7000' -> '9999999993000'
  220. dqsub350 subtract '10000e+9' '70000' -> '9999999930000'
  221. dqsub351 subtract '10000e+9' '700000' -> '9999999300000'
  222. dqsub352 subtract '7' '10000e+9' -> '-9999999999993'
  223. dqsub353 subtract '70' '10000e+9' -> '-9999999999930'
  224. dqsub354 subtract '700' '10000e+9' -> '-9999999999300'
  225. dqsub355 subtract '7000' '10000e+9' -> '-9999999993000'
  226. dqsub356 subtract '70000' '10000e+9' -> '-9999999930000'
  227. dqsub357 subtract '700000' '10000e+9' -> '-9999999300000'
  228. -- zero preservation
  229. dqsub361 subtract 1 '0.0001' -> '0.9999'
  230. dqsub362 subtract 1 '0.00001' -> '0.99999'
  231. dqsub363 subtract 1 '0.000001' -> '0.999999'
  232. dqsub364 subtract 1 '0.0000000000000000000000000000000001' -> '0.9999999999999999999999999999999999'
  233. dqsub365 subtract 1 '0.00000000000000000000000000000000001' -> '1.000000000000000000000000000000000' Inexact Rounded
  234. dqsub366 subtract 1 '0.000000000000000000000000000000000001' -> '1.000000000000000000000000000000000' Inexact Rounded
  235. -- some funny zeros [in case of bad signum]
  236. dqsub370 subtract 1 0 -> 1
  237. dqsub371 subtract 1 0. -> 1
  238. dqsub372 subtract 1 .0 -> 1.0
  239. dqsub373 subtract 1 0.0 -> 1.0
  240. dqsub374 subtract 0 1 -> -1
  241. dqsub375 subtract 0. 1 -> -1
  242. dqsub376 subtract .0 1 -> -1.0
  243. dqsub377 subtract 0.0 1 -> -1.0
  244. -- leading 0 digit before round
  245. dqsub910 subtract -103519362 -51897955.3 -> -51621406.7
  246. dqsub911 subtract 159579.444 89827.5229 -> 69751.9211
  247. dqsub920 subtract 333.0000000000000000000000000123456 33.00000000000000000000000001234566 -> 299.9999999999999999999999999999999 Inexact Rounded
  248. dqsub921 subtract 333.0000000000000000000000000123456 33.00000000000000000000000001234565 -> 300.0000000000000000000000000000000 Inexact Rounded
  249. dqsub922 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234565 -> 99.99999999999999999999999999999995
  250. dqsub923 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234564 -> 99.99999999999999999999999999999996
  251. dqsub924 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234540 -> 100.0000000000000000000000000000002 Rounded
  252. dqsub925 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234560 -> 90.00000000000000000000000000000000
  253. dqsub926 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234561 -> 89.99999999999999999999999999999999
  254. dqsub927 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234566 -> 89.99999999999999999999999999999994
  255. dqsub928 subtract 101.0000000000000000000000000123456 91.00000000000000000000000001234566 -> 9.99999999999999999999999999999994
  256. dqsub929 subtract 101.0000000000000000000000000123456 99.00000000000000000000000001234566 -> 1.99999999999999999999999999999994
  257. -- more LHS swaps [were fixed]
  258. dqsub390 subtract '-56267E-10' 0 -> '-0.0000056267'
  259. dqsub391 subtract '-56267E-6' 0 -> '-0.056267'
  260. dqsub392 subtract '-56267E-5' 0 -> '-0.56267'
  261. dqsub393 subtract '-56267E-4' 0 -> '-5.6267'
  262. dqsub394 subtract '-56267E-3' 0 -> '-56.267'
  263. dqsub395 subtract '-56267E-2' 0 -> '-562.67'
  264. dqsub396 subtract '-56267E-1' 0 -> '-5626.7'
  265. dqsub397 subtract '-56267E-0' 0 -> '-56267'
  266. dqsub398 subtract '-5E-10' 0 -> '-5E-10'
  267. dqsub399 subtract '-5E-7' 0 -> '-5E-7'
  268. dqsub400 subtract '-5E-6' 0 -> '-0.000005'
  269. dqsub401 subtract '-5E-5' 0 -> '-0.00005'
  270. dqsub402 subtract '-5E-4' 0 -> '-0.0005'
  271. dqsub403 subtract '-5E-1' 0 -> '-0.5'
  272. dqsub404 subtract '-5E0' 0 -> '-5'
  273. dqsub405 subtract '-5E1' 0 -> '-50'
  274. dqsub406 subtract '-5E5' 0 -> '-500000'
  275. dqsub407 subtract '-5E33' 0 -> '-5000000000000000000000000000000000'
  276. dqsub408 subtract '-5E34' 0 -> '-5.000000000000000000000000000000000E+34' Rounded
  277. dqsub409 subtract '-5E35' 0 -> '-5.000000000000000000000000000000000E+35' Rounded
  278. dqsub410 subtract '-5E36' 0 -> '-5.000000000000000000000000000000000E+36' Rounded
  279. dqsub411 subtract '-5E100' 0 -> '-5.000000000000000000000000000000000E+100' Rounded
  280. -- more RHS swaps [were fixed]
  281. dqsub420 subtract 0 '-56267E-10' -> '0.0000056267'
  282. dqsub421 subtract 0 '-56267E-6' -> '0.056267'
  283. dqsub422 subtract 0 '-56267E-5' -> '0.56267'
  284. dqsub423 subtract 0 '-56267E-4' -> '5.6267'
  285. dqsub424 subtract 0 '-56267E-3' -> '56.267'
  286. dqsub425 subtract 0 '-56267E-2' -> '562.67'
  287. dqsub426 subtract 0 '-56267E-1' -> '5626.7'
  288. dqsub427 subtract 0 '-56267E-0' -> '56267'
  289. dqsub428 subtract 0 '-5E-10' -> '5E-10'
  290. dqsub429 subtract 0 '-5E-7' -> '5E-7'
  291. dqsub430 subtract 0 '-5E-6' -> '0.000005'
  292. dqsub431 subtract 0 '-5E-5' -> '0.00005'
  293. dqsub432 subtract 0 '-5E-4' -> '0.0005'
  294. dqsub433 subtract 0 '-5E-1' -> '0.5'
  295. dqsub434 subtract 0 '-5E0' -> '5'
  296. dqsub435 subtract 0 '-5E1' -> '50'
  297. dqsub436 subtract 0 '-5E5' -> '500000'
  298. dqsub437 subtract 0 '-5E33' -> '5000000000000000000000000000000000'
  299. dqsub438 subtract 0 '-5E34' -> '5.000000000000000000000000000000000E+34' Rounded
  300. dqsub439 subtract 0 '-5E35' -> '5.000000000000000000000000000000000E+35' Rounded
  301. dqsub440 subtract 0 '-5E36' -> '5.000000000000000000000000000000000E+36' Rounded
  302. dqsub441 subtract 0 '-5E100' -> '5.000000000000000000000000000000000E+100' Rounded
  303. -- try borderline precision, with carries, etc.
  304. dqsub461 subtract '1E+16' '1' -> '9999999999999999'
  305. dqsub462 subtract '1E+12' '-1.111' -> '1000000000001.111'
  306. dqsub463 subtract '1.111' '-1E+12' -> '1000000000001.111'
  307. dqsub464 subtract '-1' '-1E+16' -> '9999999999999999'
  308. dqsub465 subtract '7E+15' '1' -> '6999999999999999'
  309. dqsub466 subtract '7E+12' '-1.111' -> '7000000000001.111'
  310. dqsub467 subtract '1.111' '-7E+12' -> '7000000000001.111'
  311. dqsub468 subtract '-1' '-7E+15' -> '6999999999999999'
  312. -- 1234567890123456 1234567890123456 1 23456789012345
  313. dqsub470 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555563' -> '1.000000000000000000000000000000001' Inexact Rounded
  314. dqsub471 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555562' -> '1.000000000000000000000000000000001' Inexact Rounded
  315. dqsub472 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555561' -> '1.000000000000000000000000000000000' Inexact Rounded
  316. dqsub473 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555560' -> '1.000000000000000000000000000000000' Inexact Rounded
  317. dqsub474 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555559' -> '1.000000000000000000000000000000000' Inexact Rounded
  318. dqsub475 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555558' -> '1.000000000000000000000000000000000' Inexact Rounded
  319. dqsub476 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555557' -> '1.000000000000000000000000000000000' Inexact Rounded
  320. dqsub477 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555556' -> '1.000000000000000000000000000000000' Rounded
  321. dqsub478 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999'
  322. dqsub479 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555554' -> '0.9999999999999999999999999999999998'
  323. dqsub480 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555553' -> '0.9999999999999999999999999999999997'
  324. dqsub481 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555552' -> '0.9999999999999999999999999999999996'
  325. dqsub482 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555551' -> '0.9999999999999999999999999999999995'
  326. dqsub483 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555550' -> '0.9999999999999999999999999999999994'
  327. -- and some more, including residue effects and different roundings
  328. rounding: half_up
  329. dqsub500 subtract '1231234555555555555555555567456789' 0 -> '1231234555555555555555555567456789'
  330. dqsub501 subtract '1231234555555555555555555567456789' 0.000000001 -> '1231234555555555555555555567456789' Inexact Rounded
  331. dqsub502 subtract '1231234555555555555555555567456789' 0.000001 -> '1231234555555555555555555567456789' Inexact Rounded
  332. dqsub503 subtract '1231234555555555555555555567456789' 0.1 -> '1231234555555555555555555567456789' Inexact Rounded
  333. dqsub504 subtract '1231234555555555555555555567456789' 0.4 -> '1231234555555555555555555567456789' Inexact Rounded
  334. dqsub505 subtract '1231234555555555555555555567456789' 0.49 -> '1231234555555555555555555567456789' Inexact Rounded
  335. dqsub506 subtract '1231234555555555555555555567456789' 0.499999 -> '1231234555555555555555555567456789' Inexact Rounded
  336. dqsub507 subtract '1231234555555555555555555567456789' 0.499999999 -> '1231234555555555555555555567456789' Inexact Rounded
  337. dqsub508 subtract '1231234555555555555555555567456789' 0.5 -> '1231234555555555555555555567456789' Inexact Rounded
  338. dqsub509 subtract '1231234555555555555555555567456789' 0.500000001 -> '1231234555555555555555555567456788' Inexact Rounded
  339. dqsub510 subtract '1231234555555555555555555567456789' 0.500001 -> '1231234555555555555555555567456788' Inexact Rounded
  340. dqsub511 subtract '1231234555555555555555555567456789' 0.51 -> '1231234555555555555555555567456788' Inexact Rounded
  341. dqsub512 subtract '1231234555555555555555555567456789' 0.6 -> '1231234555555555555555555567456788' Inexact Rounded
  342. dqsub513 subtract '1231234555555555555555555567456789' 0.9 -> '1231234555555555555555555567456788' Inexact Rounded
  343. dqsub514 subtract '1231234555555555555555555567456789' 0.99999 -> '1231234555555555555555555567456788' Inexact Rounded
  344. dqsub515 subtract '1231234555555555555555555567456789' 0.999999999 -> '1231234555555555555555555567456788' Inexact Rounded
  345. dqsub516 subtract '1231234555555555555555555567456789' 1 -> '1231234555555555555555555567456788'
  346. dqsub517 subtract '1231234555555555555555555567456789' 1.000000001 -> '1231234555555555555555555567456788' Inexact Rounded
  347. dqsub518 subtract '1231234555555555555555555567456789' 1.00001 -> '1231234555555555555555555567456788' Inexact Rounded
  348. dqsub519 subtract '1231234555555555555555555567456789' 1.1 -> '1231234555555555555555555567456788' Inexact Rounded
  349. rounding: half_even
  350. dqsub520 subtract '1231234555555555555555555567456789' 0 -> '1231234555555555555555555567456789'
  351. dqsub521 subtract '1231234555555555555555555567456789' 0.000000001 -> '1231234555555555555555555567456789' Inexact Rounded
  352. dqsub522 subtract '1231234555555555555555555567456789' 0.000001 -> '1231234555555555555555555567456789' Inexact Rounded
  353. dqsub523 subtract '1231234555555555555555555567456789' 0.1 -> '1231234555555555555555555567456789' Inexact Rounded
  354. dqsub524 subtract '1231234555555555555555555567456789' 0.4 -> '1231234555555555555555555567456789' Inexact Rounded
  355. dqsub525 subtract '1231234555555555555555555567456789' 0.49 -> '1231234555555555555555555567456789' Inexact Rounded
  356. dqsub526 subtract '1231234555555555555555555567456789' 0.499999 -> '1231234555555555555555555567456789' Inexact Rounded
  357. dqsub527 subtract '1231234555555555555555555567456789' 0.499999999 -> '1231234555555555555555555567456789' Inexact Rounded
  358. dqsub528 subtract '1231234555555555555555555567456789' 0.5 -> '1231234555555555555555555567456788' Inexact Rounded
  359. dqsub529 subtract '1231234555555555555555555567456789' 0.500000001 -> '1231234555555555555555555567456788' Inexact Rounded
  360. dqsub530 subtract '1231234555555555555555555567456789' 0.500001 -> '1231234555555555555555555567456788' Inexact Rounded
  361. dqsub531 subtract '1231234555555555555555555567456789' 0.51 -> '1231234555555555555555555567456788' Inexact Rounded
  362. dqsub532 subtract '1231234555555555555555555567456789' 0.6 -> '1231234555555555555555555567456788' Inexact Rounded
  363. dqsub533 subtract '1231234555555555555555555567456789' 0.9 -> '1231234555555555555555555567456788' Inexact Rounded
  364. dqsub534 subtract '1231234555555555555555555567456789' 0.99999 -> '1231234555555555555555555567456788' Inexact Rounded
  365. dqsub535 subtract '1231234555555555555555555567456789' 0.999999999 -> '1231234555555555555555555567456788' Inexact Rounded
  366. dqsub536 subtract '1231234555555555555555555567456789' 1 -> '1231234555555555555555555567456788'
  367. dqsub537 subtract '1231234555555555555555555567456789' 1.00000001 -> '1231234555555555555555555567456788' Inexact Rounded
  368. dqsub538 subtract '1231234555555555555555555567456789' 1.00001 -> '1231234555555555555555555567456788' Inexact Rounded
  369. dqsub539 subtract '1231234555555555555555555567456789' 1.1 -> '1231234555555555555555555567456788' Inexact Rounded
  370. -- critical few with even bottom digit...
  371. dqsub540 subtract '1231234555555555555555555567456788' 0.499999999 -> '1231234555555555555555555567456788' Inexact Rounded
  372. dqsub541 subtract '1231234555555555555555555567456788' 0.5 -> '1231234555555555555555555567456788' Inexact Rounded
  373. dqsub542 subtract '1231234555555555555555555567456788' 0.500000001 -> '1231234555555555555555555567456787' Inexact Rounded
  374. rounding: down
  375. dqsub550 subtract '1231234555555555555555555567456789' 0 -> '1231234555555555555555555567456789'
  376. dqsub551 subtract '1231234555555555555555555567456789' 0.000000001 -> '1231234555555555555555555567456788' Inexact Rounded
  377. dqsub552 subtract '1231234555555555555555555567456789' 0.000001 -> '1231234555555555555555555567456788' Inexact Rounded
  378. dqsub553 subtract '1231234555555555555555555567456789' 0.1 -> '1231234555555555555555555567456788' Inexact Rounded
  379. dqsub554 subtract '1231234555555555555555555567456789' 0.4 -> '1231234555555555555555555567456788' Inexact Rounded
  380. dqsub555 subtract '1231234555555555555555555567456789' 0.49 -> '1231234555555555555555555567456788' Inexact Rounded
  381. dqsub556 subtract '1231234555555555555555555567456789' 0.499999 -> '1231234555555555555555555567456788' Inexact Rounded
  382. dqsub557 subtract '1231234555555555555555555567456789' 0.499999999 -> '1231234555555555555555555567456788' Inexact Rounded
  383. dqsub558 subtract '1231234555555555555555555567456789' 0.5 -> '1231234555555555555555555567456788' Inexact Rounded
  384. dqsub559 subtract '1231234555555555555555555567456789' 0.500000001 -> '1231234555555555555555555567456788' Inexact Rounded
  385. dqsub560 subtract '1231234555555555555555555567456789' 0.500001 -> '1231234555555555555555555567456788' Inexact Rounded
  386. dqsub561 subtract '1231234555555555555555555567456789' 0.51 -> '1231234555555555555555555567456788' Inexact Rounded
  387. dqsub562 subtract '1231234555555555555555555567456789' 0.6 -> '1231234555555555555555555567456788' Inexact Rounded
  388. dqsub563 subtract '1231234555555555555555555567456789' 0.9 -> '1231234555555555555555555567456788' Inexact Rounded
  389. dqsub564 subtract '1231234555555555555555555567456789' 0.99999 -> '1231234555555555555555555567456788' Inexact Rounded
  390. dqsub565 subtract '1231234555555555555555555567456789' 0.999999999 -> '1231234555555555555555555567456788' Inexact Rounded
  391. dqsub566 subtract '1231234555555555555555555567456789' 1 -> '1231234555555555555555555567456788'
  392. dqsub567 subtract '1231234555555555555555555567456789' 1.00000001 -> '1231234555555555555555555567456787' Inexact Rounded
  393. dqsub568 subtract '1231234555555555555555555567456789' 1.00001 -> '1231234555555555555555555567456787' Inexact Rounded
  394. dqsub569 subtract '1231234555555555555555555567456789' 1.1 -> '1231234555555555555555555567456787' Inexact Rounded
  395. -- symmetry...
  396. rounding: half_up
  397. dqsub600 subtract 0 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789'
  398. dqsub601 subtract 0.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
  399. dqsub602 subtract 0.000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
  400. dqsub603 subtract 0.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
  401. dqsub604 subtract 0.4 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
  402. dqsub605 subtract 0.49 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
  403. dqsub606 subtract 0.499999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
  404. dqsub607 subtract 0.499999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
  405. dqsub608 subtract 0.5 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
  406. dqsub609 subtract 0.500000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  407. dqsub610 subtract 0.500001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  408. dqsub611 subtract 0.51 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  409. dqsub612 subtract 0.6 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  410. dqsub613 subtract 0.9 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  411. dqsub614 subtract 0.99999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  412. dqsub615 subtract 0.999999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  413. dqsub616 subtract 1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788'
  414. dqsub617 subtract 1.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  415. dqsub618 subtract 1.00001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  416. dqsub619 subtract 1.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  417. rounding: half_even
  418. dqsub620 subtract 0 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789'
  419. dqsub621 subtract 0.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
  420. dqsub622 subtract 0.000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
  421. dqsub623 subtract 0.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
  422. dqsub624 subtract 0.4 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
  423. dqsub625 subtract 0.49 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
  424. dqsub626 subtract 0.499999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
  425. dqsub627 subtract 0.499999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
  426. dqsub628 subtract 0.5 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  427. dqsub629 subtract 0.500000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  428. dqsub630 subtract 0.500001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  429. dqsub631 subtract 0.51 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  430. dqsub632 subtract 0.6 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  431. dqsub633 subtract 0.9 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  432. dqsub634 subtract 0.99999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  433. dqsub635 subtract 0.999999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  434. dqsub636 subtract 1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788'
  435. dqsub637 subtract 1.00000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  436. dqsub638 subtract 1.00001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  437. dqsub639 subtract 1.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  438. -- critical few with even bottom digit...
  439. dqsub640 subtract 0.499999999 '1231234555555555555555555567456788' -> '-1231234555555555555555555567456788' Inexact Rounded
  440. dqsub641 subtract 0.5 '1231234555555555555555555567456788' -> '-1231234555555555555555555567456788' Inexact Rounded
  441. dqsub642 subtract 0.500000001 '1231234555555555555555555567456788' -> '-1231234555555555555555555567456787' Inexact Rounded
  442. rounding: down
  443. dqsub650 subtract 0 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789'
  444. dqsub651 subtract 0.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  445. dqsub652 subtract 0.000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  446. dqsub653 subtract 0.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  447. dqsub654 subtract 0.4 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  448. dqsub655 subtract 0.49 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  449. dqsub656 subtract 0.499999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  450. dqsub657 subtract 0.499999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  451. dqsub658 subtract 0.5 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  452. dqsub659 subtract 0.500000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  453. dqsub660 subtract 0.500001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  454. dqsub661 subtract 0.51 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  455. dqsub662 subtract 0.6 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  456. dqsub663 subtract 0.9 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  457. dqsub664 subtract 0.99999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  458. dqsub665 subtract 0.999999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
  459. dqsub666 subtract 1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788'
  460. dqsub667 subtract 1.00000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded
  461. dqsub668 subtract 1.00001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded
  462. dqsub669 subtract 1.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded
  463. -- lots of leading zeros in intermediate result, and showing effects of
  464. -- input rounding would have affected the following
  465. rounding: half_up
  466. dqsub670 subtract '1234567456789' '1234567456788.1' -> 0.9
  467. dqsub671 subtract '1234567456789' '1234567456788.9' -> 0.1
  468. dqsub672 subtract '1234567456789' '1234567456789.1' -> -0.1
  469. dqsub673 subtract '1234567456789' '1234567456789.5' -> -0.5
  470. dqsub674 subtract '1234567456789' '1234567456789.9' -> -0.9
  471. rounding: half_even
  472. dqsub680 subtract '1234567456789' '1234567456788.1' -> 0.9
  473. dqsub681 subtract '1234567456789' '1234567456788.9' -> 0.1
  474. dqsub682 subtract '1234567456789' '1234567456789.1' -> -0.1
  475. dqsub683 subtract '1234567456789' '1234567456789.5' -> -0.5
  476. dqsub684 subtract '1234567456789' '1234567456789.9' -> -0.9
  477. dqsub685 subtract '1234567456788' '1234567456787.1' -> 0.9
  478. dqsub686 subtract '1234567456788' '1234567456787.9' -> 0.1
  479. dqsub687 subtract '1234567456788' '1234567456788.1' -> -0.1
  480. dqsub688 subtract '1234567456788' '1234567456788.5' -> -0.5
  481. dqsub689 subtract '1234567456788' '1234567456788.9' -> -0.9
  482. rounding: down
  483. dqsub690 subtract '1234567456789' '1234567456788.1' -> 0.9
  484. dqsub691 subtract '1234567456789' '1234567456788.9' -> 0.1
  485. dqsub692 subtract '1234567456789' '1234567456789.1' -> -0.1
  486. dqsub693 subtract '1234567456789' '1234567456789.5' -> -0.5
  487. dqsub694 subtract '1234567456789' '1234567456789.9' -> -0.9
  488. -- Specials
  489. dqsub780 subtract -Inf Inf -> -Infinity
  490. dqsub781 subtract -Inf 1000 -> -Infinity
  491. dqsub782 subtract -Inf 1 -> -Infinity
  492. dqsub783 subtract -Inf -0 -> -Infinity
  493. dqsub784 subtract -Inf -1 -> -Infinity
  494. dqsub785 subtract -Inf -1000 -> -Infinity
  495. dqsub787 subtract -1000 Inf -> -Infinity
  496. dqsub788 subtract -Inf Inf -> -Infinity
  497. dqsub789 subtract -1 Inf -> -Infinity
  498. dqsub790 subtract 0 Inf -> -Infinity
  499. dqsub791 subtract 1 Inf -> -Infinity
  500. dqsub792 subtract 1000 Inf -> -Infinity
  501. dqsub800 subtract Inf Inf -> NaN Invalid_operation
  502. dqsub801 subtract Inf 1000 -> Infinity
  503. dqsub802 subtract Inf 1 -> Infinity
  504. dqsub803 subtract Inf 0 -> Infinity
  505. dqsub804 subtract Inf -0 -> Infinity
  506. dqsub805 subtract Inf -1 -> Infinity
  507. dqsub806 subtract Inf -1000 -> Infinity
  508. dqsub807 subtract Inf -Inf -> Infinity
  509. dqsub808 subtract -1000 -Inf -> Infinity
  510. dqsub809 subtract -Inf -Inf -> NaN Invalid_operation
  511. dqsub810 subtract -1 -Inf -> Infinity
  512. dqsub811 subtract -0 -Inf -> Infinity
  513. dqsub812 subtract 0 -Inf -> Infinity
  514. dqsub813 subtract 1 -Inf -> Infinity
  515. dqsub814 subtract 1000 -Inf -> Infinity
  516. dqsub815 subtract Inf -Inf -> Infinity
  517. dqsub821 subtract NaN Inf -> NaN
  518. dqsub822 subtract -NaN 1000 -> -NaN
  519. dqsub823 subtract NaN 1 -> NaN
  520. dqsub824 subtract NaN 0 -> NaN
  521. dqsub825 subtract NaN -0 -> NaN
  522. dqsub826 subtract NaN -1 -> NaN
  523. dqsub827 subtract NaN -1000 -> NaN
  524. dqsub828 subtract NaN -Inf -> NaN
  525. dqsub829 subtract -NaN NaN -> -NaN
  526. dqsub830 subtract -Inf NaN -> NaN
  527. dqsub831 subtract -1000 NaN -> NaN
  528. dqsub832 subtract -1 NaN -> NaN
  529. dqsub833 subtract -0 NaN -> NaN
  530. dqsub834 subtract 0 NaN -> NaN
  531. dqsub835 subtract 1 NaN -> NaN
  532. dqsub836 subtract 1000 -NaN -> -NaN
  533. dqsub837 subtract Inf NaN -> NaN
  534. dqsub841 subtract sNaN Inf -> NaN Invalid_operation
  535. dqsub842 subtract -sNaN 1000 -> -NaN Invalid_operation
  536. dqsub843 subtract sNaN 1 -> NaN Invalid_operation
  537. dqsub844 subtract sNaN 0 -> NaN Invalid_operation
  538. dqsub845 subtract sNaN -0 -> NaN Invalid_operation
  539. dqsub846 subtract sNaN -1 -> NaN Invalid_operation
  540. dqsub847 subtract sNaN -1000 -> NaN Invalid_operation
  541. dqsub848 subtract sNaN NaN -> NaN Invalid_operation
  542. dqsub849 subtract sNaN sNaN -> NaN Invalid_operation
  543. dqsub850 subtract NaN sNaN -> NaN Invalid_operation
  544. dqsub851 subtract -Inf -sNaN -> -NaN Invalid_operation
  545. dqsub852 subtract -1000 sNaN -> NaN Invalid_operation
  546. dqsub853 subtract -1 sNaN -> NaN Invalid_operation
  547. dqsub854 subtract -0 sNaN -> NaN Invalid_operation
  548. dqsub855 subtract 0 sNaN -> NaN Invalid_operation
  549. dqsub856 subtract 1 sNaN -> NaN Invalid_operation
  550. dqsub857 subtract 1000 sNaN -> NaN Invalid_operation
  551. dqsub858 subtract Inf sNaN -> NaN Invalid_operation
  552. dqsub859 subtract NaN sNaN -> NaN Invalid_operation
  553. -- propagating NaNs
  554. dqsub861 subtract NaN01 -Inf -> NaN1
  555. dqsub862 subtract -NaN02 -1000 -> -NaN2
  556. dqsub863 subtract NaN03 1000 -> NaN3
  557. dqsub864 subtract NaN04 Inf -> NaN4
  558. dqsub865 subtract NaN05 NaN61 -> NaN5
  559. dqsub866 subtract -Inf -NaN71 -> -NaN71
  560. dqsub867 subtract -1000 NaN81 -> NaN81
  561. dqsub868 subtract 1000 NaN91 -> NaN91
  562. dqsub869 subtract Inf NaN101 -> NaN101
  563. dqsub871 subtract sNaN011 -Inf -> NaN11 Invalid_operation
  564. dqsub872 subtract sNaN012 -1000 -> NaN12 Invalid_operation
  565. dqsub873 subtract -sNaN013 1000 -> -NaN13 Invalid_operation
  566. dqsub874 subtract sNaN014 NaN171 -> NaN14 Invalid_operation
  567. dqsub875 subtract sNaN015 sNaN181 -> NaN15 Invalid_operation
  568. dqsub876 subtract NaN016 sNaN191 -> NaN191 Invalid_operation
  569. dqsub877 subtract -Inf sNaN201 -> NaN201 Invalid_operation
  570. dqsub878 subtract -1000 sNaN211 -> NaN211 Invalid_operation
  571. dqsub879 subtract 1000 -sNaN221 -> -NaN221 Invalid_operation
  572. dqsub880 subtract Inf sNaN231 -> NaN231 Invalid_operation
  573. dqsub881 subtract NaN025 sNaN241 -> NaN241 Invalid_operation
  574. -- edge case spills
  575. dqsub901 subtract 2.E-3 1.002 -> -1.000
  576. dqsub902 subtract 2.0E-3 1.002 -> -1.0000
  577. dqsub903 subtract 2.00E-3 1.0020 -> -1.00000
  578. dqsub904 subtract 2.000E-3 1.00200 -> -1.000000
  579. dqsub905 subtract 2.0000E-3 1.002000 -> -1.0000000
  580. dqsub906 subtract 2.00000E-3 1.0020000 -> -1.00000000
  581. dqsub907 subtract 2.000000E-3 1.00200000 -> -1.000000000
  582. dqsub908 subtract 2.0000000E-3 1.002000000 -> -1.0000000000
  583. -- subnormals and overflows covered under Add
  584. -- Examples from SQL proposal (Krishna Kulkarni)
  585. dqsub1125 subtract 130E-2 120E-2 -> 0.10
  586. dqsub1126 subtract 130E-2 12E-1 -> 0.10
  587. dqsub1127 subtract 130E-2 1E0 -> 0.30
  588. dqsub1128 subtract 1E2 1E4 -> -9.9E+3
  589. -- Null tests
  590. dqsub9990 subtract 10 # -> NaN Invalid_operation
  591. dqsub9991 subtract # 10 -> NaN Invalid_operation