dqAdd.decTest 86 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215
  1. ------------------------------------------------------------------------
  2. -- dqAdd.decTest -- decQuad addition --
  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. dqadd001 add 1 1 -> 2
  31. dqadd002 add 2 3 -> 5
  32. dqadd003 add '5.75' '3.3' -> 9.05
  33. dqadd004 add '5' '-3' -> 2
  34. dqadd005 add '-5' '-3' -> -8
  35. dqadd006 add '-7' '2.5' -> -4.5
  36. dqadd007 add '0.7' '0.3' -> 1.0
  37. dqadd008 add '1.25' '1.25' -> 2.50
  38. dqadd009 add '1.23456789' '1.00000000' -> '2.23456789'
  39. dqadd010 add '1.23456789' '1.00000011' -> '2.23456800'
  40. -- 1234567890123456 1234567890123456
  41. dqadd011 add '0.4444444444444444444444444444444446' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Inexact Rounded
  42. dqadd012 add '0.4444444444444444444444444444444445' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Rounded
  43. dqadd013 add '0.4444444444444444444444444444444444' '0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999'
  44. dqadd014 add '4444444444444444444444444444444444' '0.49' -> '4444444444444444444444444444444444' Inexact Rounded
  45. dqadd015 add '4444444444444444444444444444444444' '0.499' -> '4444444444444444444444444444444444' Inexact Rounded
  46. dqadd016 add '4444444444444444444444444444444444' '0.4999' -> '4444444444444444444444444444444444' Inexact Rounded
  47. dqadd017 add '4444444444444444444444444444444444' '0.5000' -> '4444444444444444444444444444444444' Inexact Rounded
  48. dqadd018 add '4444444444444444444444444444444444' '0.5001' -> '4444444444444444444444444444444445' Inexact Rounded
  49. dqadd019 add '4444444444444444444444444444444444' '0.501' -> '4444444444444444444444444444444445' Inexact Rounded
  50. dqadd020 add '4444444444444444444444444444444444' '0.51' -> '4444444444444444444444444444444445' Inexact Rounded
  51. dqadd021 add 0 1 -> 1
  52. dqadd022 add 1 1 -> 2
  53. dqadd023 add 2 1 -> 3
  54. dqadd024 add 3 1 -> 4
  55. dqadd025 add 4 1 -> 5
  56. dqadd026 add 5 1 -> 6
  57. dqadd027 add 6 1 -> 7
  58. dqadd028 add 7 1 -> 8
  59. dqadd029 add 8 1 -> 9
  60. dqadd030 add 9 1 -> 10
  61. -- some carrying effects
  62. dqadd031 add '0.9998' '0.0000' -> '0.9998'
  63. dqadd032 add '0.9998' '0.0001' -> '0.9999'
  64. dqadd033 add '0.9998' '0.0002' -> '1.0000'
  65. dqadd034 add '0.9998' '0.0003' -> '1.0001'
  66. dqadd035 add '70' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
  67. dqadd036 add '700' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
  68. dqadd037 add '7000' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
  69. dqadd038 add '70000' '10000e+34' -> '1.000000000000000000000000000000001E+38' Inexact Rounded
  70. dqadd039 add '700000' '10000e+34' -> '1.000000000000000000000000000000007E+38' Rounded
  71. -- symmetry:
  72. dqadd040 add '10000e+34' '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
  73. dqadd041 add '10000e+34' '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
  74. dqadd042 add '10000e+34' '7000' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
  75. dqadd044 add '10000e+34' '70000' -> '1.000000000000000000000000000000001E+38' Inexact Rounded
  76. dqadd045 add '10000e+34' '700000' -> '1.000000000000000000000000000000007E+38' Rounded
  77. -- same, without rounding
  78. dqadd046 add '10000e+9' '7' -> '10000000000007'
  79. dqadd047 add '10000e+9' '70' -> '10000000000070'
  80. dqadd048 add '10000e+9' '700' -> '10000000000700'
  81. dqadd049 add '10000e+9' '7000' -> '10000000007000'
  82. dqadd050 add '10000e+9' '70000' -> '10000000070000'
  83. dqadd051 add '10000e+9' '700000' -> '10000000700000'
  84. dqadd052 add '10000e+9' '7000000' -> '10000007000000'
  85. -- examples from decarith
  86. dqadd053 add '12' '7.00' -> '19.00'
  87. dqadd054 add '1.3' '-1.07' -> '0.23'
  88. dqadd055 add '1.3' '-1.30' -> '0.00'
  89. dqadd056 add '1.3' '-2.07' -> '-0.77'
  90. dqadd057 add '1E+2' '1E+4' -> '1.01E+4'
  91. -- leading zero preservation
  92. dqadd061 add 1 '0.0001' -> '1.0001'
  93. dqadd062 add 1 '0.00001' -> '1.00001'
  94. dqadd063 add 1 '0.000001' -> '1.000001'
  95. dqadd064 add 1 '0.0000001' -> '1.0000001'
  96. dqadd065 add 1 '0.00000001' -> '1.00000001'
  97. -- some funny zeros [in case of bad signum]
  98. dqadd070 add 1 0 -> 1
  99. dqadd071 add 1 0. -> 1
  100. dqadd072 add 1 .0 -> 1.0
  101. dqadd073 add 1 0.0 -> 1.0
  102. dqadd074 add 1 0.00 -> 1.00
  103. dqadd075 add 0 1 -> 1
  104. dqadd076 add 0. 1 -> 1
  105. dqadd077 add .0 1 -> 1.0
  106. dqadd078 add 0.0 1 -> 1.0
  107. dqadd079 add 0.00 1 -> 1.00
  108. -- some carries
  109. dqadd080 add 999999998 1 -> 999999999
  110. dqadd081 add 999999999 1 -> 1000000000
  111. dqadd082 add 99999999 1 -> 100000000
  112. dqadd083 add 9999999 1 -> 10000000
  113. dqadd084 add 999999 1 -> 1000000
  114. dqadd085 add 99999 1 -> 100000
  115. dqadd086 add 9999 1 -> 10000
  116. dqadd087 add 999 1 -> 1000
  117. dqadd088 add 99 1 -> 100
  118. dqadd089 add 9 1 -> 10
  119. -- more LHS swaps
  120. dqadd090 add '-56267E-10' 0 -> '-0.0000056267'
  121. dqadd091 add '-56267E-6' 0 -> '-0.056267'
  122. dqadd092 add '-56267E-5' 0 -> '-0.56267'
  123. dqadd093 add '-56267E-4' 0 -> '-5.6267'
  124. dqadd094 add '-56267E-3' 0 -> '-56.267'
  125. dqadd095 add '-56267E-2' 0 -> '-562.67'
  126. dqadd096 add '-56267E-1' 0 -> '-5626.7'
  127. dqadd097 add '-56267E-0' 0 -> '-56267'
  128. dqadd098 add '-5E-10' 0 -> '-5E-10'
  129. dqadd099 add '-5E-7' 0 -> '-5E-7'
  130. dqadd100 add '-5E-6' 0 -> '-0.000005'
  131. dqadd101 add '-5E-5' 0 -> '-0.00005'
  132. dqadd102 add '-5E-4' 0 -> '-0.0005'
  133. dqadd103 add '-5E-1' 0 -> '-0.5'
  134. dqadd104 add '-5E0' 0 -> '-5'
  135. dqadd105 add '-5E1' 0 -> '-50'
  136. dqadd106 add '-5E5' 0 -> '-500000'
  137. dqadd107 add '-5E33' 0 -> '-5000000000000000000000000000000000'
  138. dqadd108 add '-5E34' 0 -> '-5.000000000000000000000000000000000E+34' Rounded
  139. dqadd109 add '-5E35' 0 -> '-5.000000000000000000000000000000000E+35' Rounded
  140. dqadd110 add '-5E36' 0 -> '-5.000000000000000000000000000000000E+36' Rounded
  141. dqadd111 add '-5E100' 0 -> '-5.000000000000000000000000000000000E+100' Rounded
  142. -- more RHS swaps
  143. dqadd113 add 0 '-56267E-10' -> '-0.0000056267'
  144. dqadd114 add 0 '-56267E-6' -> '-0.056267'
  145. dqadd116 add 0 '-56267E-5' -> '-0.56267'
  146. dqadd117 add 0 '-56267E-4' -> '-5.6267'
  147. dqadd119 add 0 '-56267E-3' -> '-56.267'
  148. dqadd120 add 0 '-56267E-2' -> '-562.67'
  149. dqadd121 add 0 '-56267E-1' -> '-5626.7'
  150. dqadd122 add 0 '-56267E-0' -> '-56267'
  151. dqadd123 add 0 '-5E-10' -> '-5E-10'
  152. dqadd124 add 0 '-5E-7' -> '-5E-7'
  153. dqadd125 add 0 '-5E-6' -> '-0.000005'
  154. dqadd126 add 0 '-5E-5' -> '-0.00005'
  155. dqadd127 add 0 '-5E-4' -> '-0.0005'
  156. dqadd128 add 0 '-5E-1' -> '-0.5'
  157. dqadd129 add 0 '-5E0' -> '-5'
  158. dqadd130 add 0 '-5E1' -> '-50'
  159. dqadd131 add 0 '-5E5' -> '-500000'
  160. dqadd132 add 0 '-5E33' -> '-5000000000000000000000000000000000'
  161. dqadd133 add 0 '-5E34' -> '-5.000000000000000000000000000000000E+34' Rounded
  162. dqadd134 add 0 '-5E35' -> '-5.000000000000000000000000000000000E+35' Rounded
  163. dqadd135 add 0 '-5E36' -> '-5.000000000000000000000000000000000E+36' Rounded
  164. dqadd136 add 0 '-5E100' -> '-5.000000000000000000000000000000000E+100' Rounded
  165. -- related
  166. dqadd137 add 1 '0E-39' -> '1.000000000000000000000000000000000' Rounded
  167. dqadd138 add -1 '0E-39' -> '-1.000000000000000000000000000000000' Rounded
  168. dqadd139 add '0E-39' 1 -> '1.000000000000000000000000000000000' Rounded
  169. dqadd140 add '0E-39' -1 -> '-1.000000000000000000000000000000000' Rounded
  170. dqadd141 add 1E+29 0.0000 -> '100000000000000000000000000000.0000'
  171. dqadd142 add 1E+29 0.00000 -> '100000000000000000000000000000.0000' Rounded
  172. dqadd143 add 0.000 1E+30 -> '1000000000000000000000000000000.000'
  173. dqadd144 add 0.0000 1E+30 -> '1000000000000000000000000000000.000' Rounded
  174. -- [some of the next group are really constructor tests]
  175. dqadd146 add '00.0' 0 -> '0.0'
  176. dqadd147 add '0.00' 0 -> '0.00'
  177. dqadd148 add 0 '0.00' -> '0.00'
  178. dqadd149 add 0 '00.0' -> '0.0'
  179. dqadd150 add '00.0' '0.00' -> '0.00'
  180. dqadd151 add '0.00' '00.0' -> '0.00'
  181. dqadd152 add '3' '.3' -> '3.3'
  182. dqadd153 add '3.' '.3' -> '3.3'
  183. dqadd154 add '3.0' '.3' -> '3.3'
  184. dqadd155 add '3.00' '.3' -> '3.30'
  185. dqadd156 add '3' '3' -> '6'
  186. dqadd157 add '3' '+3' -> '6'
  187. dqadd158 add '3' '-3' -> '0'
  188. dqadd159 add '0.3' '-0.3' -> '0.0'
  189. dqadd160 add '0.03' '-0.03' -> '0.00'
  190. -- try borderline precision, with carries, etc.
  191. dqadd161 add '1E+12' '-1' -> '999999999999'
  192. dqadd162 add '1E+12' '1.11' -> '1000000000001.11'
  193. dqadd163 add '1.11' '1E+12' -> '1000000000001.11'
  194. dqadd164 add '-1' '1E+12' -> '999999999999'
  195. dqadd165 add '7E+12' '-1' -> '6999999999999'
  196. dqadd166 add '7E+12' '1.11' -> '7000000000001.11'
  197. dqadd167 add '1.11' '7E+12' -> '7000000000001.11'
  198. dqadd168 add '-1' '7E+12' -> '6999999999999'
  199. rounding: half_up
  200. dqadd170 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555567' -> '5.000000000000000000000000000000001' Inexact Rounded
  201. dqadd171 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555566' -> '5.000000000000000000000000000000001' Inexact Rounded
  202. dqadd172 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555565' -> '5.000000000000000000000000000000001' Inexact Rounded
  203. dqadd173 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555564' -> '5.000000000000000000000000000000000' Inexact Rounded
  204. dqadd174 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555553' -> '4.999999999999999999999999999999999' Inexact Rounded
  205. dqadd175 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555552' -> '4.999999999999999999999999999999999' Inexact Rounded
  206. dqadd176 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555551' -> '4.999999999999999999999999999999999' Inexact Rounded
  207. dqadd177 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555550' -> '4.999999999999999999999999999999999' Rounded
  208. dqadd178 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555545' -> '4.999999999999999999999999999999999' Inexact Rounded
  209. dqadd179 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555544' -> '4.999999999999999999999999999999998' Inexact Rounded
  210. dqadd180 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555543' -> '4.999999999999999999999999999999998' Inexact Rounded
  211. dqadd181 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555542' -> '4.999999999999999999999999999999998' Inexact Rounded
  212. dqadd182 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555541' -> '4.999999999999999999999999999999998' Inexact Rounded
  213. dqadd183 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555540' -> '4.999999999999999999999999999999998' Rounded
  214. -- and some more, including residue effects and different roundings
  215. rounding: half_up
  216. dqadd200 add '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
  217. dqadd201 add '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
  218. dqadd202 add '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
  219. dqadd203 add '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
  220. dqadd204 add '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
  221. dqadd205 add '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
  222. dqadd206 add '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
  223. dqadd207 add '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
  224. dqadd208 add '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded
  225. dqadd209 add '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded
  226. dqadd210 add '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded
  227. dqadd211 add '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded
  228. dqadd212 add '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded
  229. dqadd213 add '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded
  230. dqadd214 add '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded
  231. dqadd215 add '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded
  232. dqadd216 add '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
  233. dqadd217 add '1231234567890123456784560123456789' 1.000000001 -> '1231234567890123456784560123456790' Inexact Rounded
  234. dqadd218 add '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
  235. dqadd219 add '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
  236. rounding: half_even
  237. dqadd220 add '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
  238. dqadd221 add '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
  239. dqadd222 add '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
  240. dqadd223 add '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
  241. dqadd224 add '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
  242. dqadd225 add '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
  243. dqadd226 add '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
  244. dqadd227 add '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
  245. dqadd228 add '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded
  246. dqadd229 add '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded
  247. dqadd230 add '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded
  248. dqadd231 add '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded
  249. dqadd232 add '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded
  250. dqadd233 add '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded
  251. dqadd234 add '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded
  252. dqadd235 add '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded
  253. dqadd236 add '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
  254. dqadd237 add '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded
  255. dqadd238 add '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
  256. dqadd239 add '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
  257. -- critical few with even bottom digit...
  258. dqadd240 add '1231234567890123456784560123456788' 0.499999999 -> '1231234567890123456784560123456788' Inexact Rounded
  259. dqadd241 add '1231234567890123456784560123456788' 0.5 -> '1231234567890123456784560123456788' Inexact Rounded
  260. dqadd242 add '1231234567890123456784560123456788' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded
  261. rounding: down
  262. dqadd250 add '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
  263. dqadd251 add '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
  264. dqadd252 add '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
  265. dqadd253 add '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
  266. dqadd254 add '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
  267. dqadd255 add '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
  268. dqadd256 add '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
  269. dqadd257 add '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
  270. dqadd258 add '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456789' Inexact Rounded
  271. dqadd259 add '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded
  272. dqadd260 add '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456789' Inexact Rounded
  273. dqadd261 add '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456789' Inexact Rounded
  274. dqadd262 add '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456789' Inexact Rounded
  275. dqadd263 add '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456789' Inexact Rounded
  276. dqadd264 add '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456789' Inexact Rounded
  277. dqadd265 add '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456789' Inexact Rounded
  278. dqadd266 add '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
  279. dqadd267 add '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded
  280. dqadd268 add '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
  281. dqadd269 add '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
  282. -- 1 in last place tests
  283. rounding: half_up
  284. dqadd301 add -1 1 -> 0
  285. dqadd302 add 0 1 -> 1
  286. dqadd303 add 1 1 -> 2
  287. dqadd304 add 12 1 -> 13
  288. dqadd305 add 98 1 -> 99
  289. dqadd306 add 99 1 -> 100
  290. dqadd307 add 100 1 -> 101
  291. dqadd308 add 101 1 -> 102
  292. dqadd309 add -1 -1 -> -2
  293. dqadd310 add 0 -1 -> -1
  294. dqadd311 add 1 -1 -> 0
  295. dqadd312 add 12 -1 -> 11
  296. dqadd313 add 98 -1 -> 97
  297. dqadd314 add 99 -1 -> 98
  298. dqadd315 add 100 -1 -> 99
  299. dqadd316 add 101 -1 -> 100
  300. dqadd321 add -0.01 0.01 -> 0.00
  301. dqadd322 add 0.00 0.01 -> 0.01
  302. dqadd323 add 0.01 0.01 -> 0.02
  303. dqadd324 add 0.12 0.01 -> 0.13
  304. dqadd325 add 0.98 0.01 -> 0.99
  305. dqadd326 add 0.99 0.01 -> 1.00
  306. dqadd327 add 1.00 0.01 -> 1.01
  307. dqadd328 add 1.01 0.01 -> 1.02
  308. dqadd329 add -0.01 -0.01 -> -0.02
  309. dqadd330 add 0.00 -0.01 -> -0.01
  310. dqadd331 add 0.01 -0.01 -> 0.00
  311. dqadd332 add 0.12 -0.01 -> 0.11
  312. dqadd333 add 0.98 -0.01 -> 0.97
  313. dqadd334 add 0.99 -0.01 -> 0.98
  314. dqadd335 add 1.00 -0.01 -> 0.99
  315. dqadd336 add 1.01 -0.01 -> 1.00
  316. -- some more cases where adding 0 affects the coefficient
  317. dqadd340 add 1E+3 0 -> 1000
  318. dqadd341 add 1E+33 0 -> 1000000000000000000000000000000000
  319. dqadd342 add 1E+34 0 -> 1.000000000000000000000000000000000E+34 Rounded
  320. dqadd343 add 1E+35 0 -> 1.000000000000000000000000000000000E+35 Rounded
  321. -- which simply follow from these cases ...
  322. dqadd344 add 1E+3 1 -> 1001
  323. dqadd345 add 1E+33 1 -> 1000000000000000000000000000000001
  324. dqadd346 add 1E+34 1 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  325. dqadd347 add 1E+35 1 -> 1.000000000000000000000000000000000E+35 Inexact Rounded
  326. dqadd348 add 1E+3 7 -> 1007
  327. dqadd349 add 1E+33 7 -> 1000000000000000000000000000000007
  328. dqadd350 add 1E+34 7 -> 1.000000000000000000000000000000001E+34 Inexact Rounded
  329. dqadd351 add 1E+35 7 -> 1.000000000000000000000000000000000E+35 Inexact Rounded
  330. -- tryzeros cases
  331. rounding: half_up
  332. dqadd360 add 0E+50 10000E+1 -> 1.0000E+5
  333. dqadd361 add 0E-50 10000E+1 -> 100000.0000000000000000000000000000 Rounded
  334. dqadd362 add 10000E+1 0E-50 -> 100000.0000000000000000000000000000 Rounded
  335. dqadd363 add 10000E+1 10000E-50 -> 100000.0000000000000000000000000000 Rounded Inexact
  336. dqadd364 add 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0E+6111
  337. -- 1 234567890123456789012345678901234
  338. -- a curiosity from JSR 13 testing
  339. rounding: half_down
  340. dqadd370 add 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
  341. dqadd371 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
  342. rounding: half_up
  343. dqadd372 add 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
  344. dqadd373 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
  345. rounding: half_even
  346. dqadd374 add 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
  347. dqadd375 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
  348. -- ulp replacement tests
  349. dqadd400 add 1 77e-32 -> 1.00000000000000000000000000000077
  350. dqadd401 add 1 77e-33 -> 1.000000000000000000000000000000077
  351. dqadd402 add 1 77e-34 -> 1.000000000000000000000000000000008 Inexact Rounded
  352. dqadd403 add 1 77e-35 -> 1.000000000000000000000000000000001 Inexact Rounded
  353. dqadd404 add 1 77e-36 -> 1.000000000000000000000000000000000 Inexact Rounded
  354. dqadd405 add 1 77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded
  355. dqadd406 add 1 77e-299 -> 1.000000000000000000000000000000000 Inexact Rounded
  356. dqadd410 add 10 77e-32 -> 10.00000000000000000000000000000077
  357. dqadd411 add 10 77e-33 -> 10.00000000000000000000000000000008 Inexact Rounded
  358. dqadd412 add 10 77e-34 -> 10.00000000000000000000000000000001 Inexact Rounded
  359. dqadd413 add 10 77e-35 -> 10.00000000000000000000000000000000 Inexact Rounded
  360. dqadd414 add 10 77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded
  361. dqadd415 add 10 77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded
  362. dqadd416 add 10 77e-299 -> 10.00000000000000000000000000000000 Inexact Rounded
  363. dqadd420 add 77e-32 1 -> 1.00000000000000000000000000000077
  364. dqadd421 add 77e-33 1 -> 1.000000000000000000000000000000077
  365. dqadd422 add 77e-34 1 -> 1.000000000000000000000000000000008 Inexact Rounded
  366. dqadd423 add 77e-35 1 -> 1.000000000000000000000000000000001 Inexact Rounded
  367. dqadd424 add 77e-36 1 -> 1.000000000000000000000000000000000 Inexact Rounded
  368. dqadd425 add 77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded
  369. dqadd426 add 77e-299 1 -> 1.000000000000000000000000000000000 Inexact Rounded
  370. dqadd430 add 77e-32 10 -> 10.00000000000000000000000000000077
  371. dqadd431 add 77e-33 10 -> 10.00000000000000000000000000000008 Inexact Rounded
  372. dqadd432 add 77e-34 10 -> 10.00000000000000000000000000000001 Inexact Rounded
  373. dqadd433 add 77e-35 10 -> 10.00000000000000000000000000000000 Inexact Rounded
  374. dqadd434 add 77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded
  375. dqadd435 add 77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded
  376. dqadd436 add 77e-299 10 -> 10.00000000000000000000000000000000 Inexact Rounded
  377. -- fastpath boundaries
  378. -- 1234567890123456789012345678901234
  379. dqadd501 add '4444444444444444444444444444444444' '5555555555555555555555555555555555' -> '9999999999999999999999999999999999'
  380. dqadd502 add '4444444444444444444444444444444444' '4555555555555555555555555555555555' -> '8999999999999999999999999999999999'
  381. dqadd503 add '4444444444444444444444444444444444' '3555555555555555555055555555555555' -> '7999999999999999999499999999999999'
  382. dqadd504 add '4444444444444444444444444444444444' '3955555555555555555555555555555555' -> '8399999999999999999999999999999999'
  383. dqadd505 add '4444444444444444444444444444444444' '4955555555555555555555555555555555' -> '9399999999999999999999999999999999'
  384. dqadd506 add '4444444444444444444444444444444444' '5955555555555555555555555555555555' -> 1.040000000000000000000000000000000E+34 Inexact Rounded
  385. dqadd511 add '344444444444444444444444444444444' '555555555555555555555555555555555' -> '899999999999999999999999999999999'
  386. dqadd512 add '34444444444444444444444444444444' '55555555555555555555555555555555' -> '89999999999999999999999999999999'
  387. dqadd513 add '3444444444444444444444444444444' '5555555555555555555555555555555' -> '8999999999999999999999999999999'
  388. dqadd514 add '344444444444444444444444444444' '555555555555555555555555555555' -> '899999999999999999999999999999'
  389. dqadd515 add '34444444444444444444444444444' '55555555555555555555555555555' -> '89999999999999999999999999999'
  390. dqadd516 add '3444444444444444444444444444' '5555555555555555555555555555' -> '8999999999999999999999999999'
  391. dqadd517 add '344444444444444444444444444' '555555555555555555555555555' -> '899999999999999999999999999'
  392. dqadd518 add '34444444444444444444444444' '55555555555555555555555555' -> '89999999999999999999999999'
  393. dqadd519 add '3444444444444444444444444' '5555555555555555555555555' -> '8999999999999999999999999'
  394. dqadd520 add '344444444444444444444444' '555555555555555555555555' -> '899999999999999999999999'
  395. dqadd521 add '34444444444444444444444' '55555555555555555555555' -> '89999999999999999999999'
  396. dqadd522 add '3444444444444444444444' '5555555555555555555555' -> '8999999999999999999999'
  397. dqadd523 add '4444444444444444444444' '3333333333333333333333' -> '7777777777777777777777'
  398. dqadd524 add '344444444444444444444' '555555555555555555555' -> '899999999999999999999'
  399. dqadd525 add '34444444444444444444' '55555555555555555555' -> '89999999999999999999'
  400. dqadd526 add '3444444444444444444' '5555555555555555555' -> '8999999999999999999'
  401. dqadd527 add '344444444444444444' '555555555555555555' -> '899999999999999999'
  402. dqadd528 add '34444444444444444' '55555555555555555' -> '89999999999999999'
  403. dqadd529 add '3444444444444444' '5555555555555555' -> '8999999999999999'
  404. dqadd530 add '344444444444444' '555555555555555' -> '899999999999999'
  405. dqadd531 add '34444444444444' '55555555555555' -> '89999999999999'
  406. dqadd532 add '3444444444444' '5555555555555' -> '8999999999999'
  407. dqadd533 add '344444444444' '555555555555' -> '899999999999'
  408. dqadd534 add '34444444444' '55555555555' -> '89999999999'
  409. dqadd535 add '3444444444' '5555555555' -> '8999999999'
  410. dqadd536 add '344444444' '555555555' -> '899999999'
  411. dqadd537 add '34444444' '55555555' -> '89999999'
  412. dqadd538 add '3444444' '5555555' -> '8999999'
  413. dqadd539 add '344444' '555555' -> '899999'
  414. dqadd540 add '34444' '55555' -> '89999'
  415. dqadd541 add '3444' '5555' -> '8999'
  416. dqadd542 add '344' '555' -> '899'
  417. dqadd543 add '34' '55' -> '89'
  418. dqadd544 add '3' '5' -> '8'
  419. dqadd545 add '3000004000000000000000000000000000' '3000000000000040000000000000000000' -> '6000004000000040000000000000000000'
  420. dqadd546 add '3000000400000000000000000000000000' '4000000000000400000000000000000000' -> '7000000400000400000000000000000000'
  421. dqadd547 add '3000000040000000000000000000000000' '5000000000004000000000000000000000' -> '8000000040004000000000000000000000'
  422. dqadd548 add '4000000004000000000000000000000000' '3000000000040000000000000000000000' -> '7000000004040000000000000000000000'
  423. dqadd549 add '4000000000400000000000000000000000' '4000000000400000000000000000000000' -> '8000000000800000000000000000000000'
  424. dqadd550 add '4000000000040000000000000000000000' '5000000004000000000000000000000000' -> '9000000004040000000000000000000000'
  425. dqadd551 add '5000000000004000000000000000000000' '3000000040000000000000000000000000' -> '8000000040004000000000000000000000'
  426. dqadd552 add '5000000000000400000000000000000000' '4000000400000000000000000000000000' -> '9000000400000400000000000000000000'
  427. dqadd553 add '5000000000000040000000000000000000' '5000004000000000000000000000000000' -> 1.000000400000004000000000000000000E+34 Rounded
  428. -- check propagation
  429. dqadd554 add '8999999999999999999999999999999999' '0000000000000000000000000000000001' -> 9000000000000000000000000000000000
  430. dqadd555 add '0000000000000000000000000000000001' '8999999999999999999999999999999999' -> 9000000000000000000000000000000000
  431. dqadd556 add '4444444444444444444444444444444444' '4555555555555555555555555555555556' -> 9000000000000000000000000000000000
  432. dqadd557 add '4555555555555555555555555555555556' '4444444444444444444444444444444444' -> 9000000000000000000000000000000000
  433. -- negative ulps
  434. dqadd6440 add 1 -77e-32 -> 0.99999999999999999999999999999923
  435. dqadd6441 add 1 -77e-33 -> 0.999999999999999999999999999999923
  436. dqadd6442 add 1 -77e-34 -> 0.9999999999999999999999999999999923
  437. dqadd6443 add 1 -77e-35 -> 0.9999999999999999999999999999999992 Inexact Rounded
  438. dqadd6444 add 1 -77e-36 -> 0.9999999999999999999999999999999999 Inexact Rounded
  439. dqadd6445 add 1 -77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded
  440. dqadd6446 add 1 -77e-99 -> 1.000000000000000000000000000000000 Inexact Rounded
  441. dqadd6450 add 10 -77e-32 -> 9.99999999999999999999999999999923
  442. dqadd6451 add 10 -77e-33 -> 9.999999999999999999999999999999923
  443. dqadd6452 add 10 -77e-34 -> 9.999999999999999999999999999999992 Inexact Rounded
  444. dqadd6453 add 10 -77e-35 -> 9.999999999999999999999999999999999 Inexact Rounded
  445. dqadd6454 add 10 -77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded
  446. dqadd6455 add 10 -77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded
  447. dqadd6456 add 10 -77e-99 -> 10.00000000000000000000000000000000 Inexact Rounded
  448. dqadd6460 add -77e-32 1 -> 0.99999999999999999999999999999923
  449. dqadd6461 add -77e-33 1 -> 0.999999999999999999999999999999923
  450. dqadd6462 add -77e-34 1 -> 0.9999999999999999999999999999999923
  451. dqadd6463 add -77e-35 1 -> 0.9999999999999999999999999999999992 Inexact Rounded
  452. dqadd6464 add -77e-36 1 -> 0.9999999999999999999999999999999999 Inexact Rounded
  453. dqadd6465 add -77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded
  454. dqadd6466 add -77e-99 1 -> 1.000000000000000000000000000000000 Inexact Rounded
  455. dqadd6470 add -77e-32 10 -> 9.99999999999999999999999999999923
  456. dqadd6471 add -77e-33 10 -> 9.999999999999999999999999999999923
  457. dqadd6472 add -77e-34 10 -> 9.999999999999999999999999999999992 Inexact Rounded
  458. dqadd6473 add -77e-35 10 -> 9.999999999999999999999999999999999 Inexact Rounded
  459. dqadd6474 add -77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded
  460. dqadd6475 add -77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded
  461. dqadd6476 add -77e-99 10 -> 10.00000000000000000000000000000000 Inexact Rounded
  462. -- negative ulps
  463. dqadd6480 add -1 77e-32 -> -0.99999999999999999999999999999923
  464. dqadd6481 add -1 77e-33 -> -0.999999999999999999999999999999923
  465. dqadd6482 add -1 77e-34 -> -0.9999999999999999999999999999999923
  466. dqadd6483 add -1 77e-35 -> -0.9999999999999999999999999999999992 Inexact Rounded
  467. dqadd6484 add -1 77e-36 -> -0.9999999999999999999999999999999999 Inexact Rounded
  468. dqadd6485 add -1 77e-37 -> -1.000000000000000000000000000000000 Inexact Rounded
  469. dqadd6486 add -1 77e-99 -> -1.000000000000000000000000000000000 Inexact Rounded
  470. dqadd6490 add -10 77e-32 -> -9.99999999999999999999999999999923
  471. dqadd6491 add -10 77e-33 -> -9.999999999999999999999999999999923
  472. dqadd6492 add -10 77e-34 -> -9.999999999999999999999999999999992 Inexact Rounded
  473. dqadd6493 add -10 77e-35 -> -9.999999999999999999999999999999999 Inexact Rounded
  474. dqadd6494 add -10 77e-36 -> -10.00000000000000000000000000000000 Inexact Rounded
  475. dqadd6495 add -10 77e-37 -> -10.00000000000000000000000000000000 Inexact Rounded
  476. dqadd6496 add -10 77e-99 -> -10.00000000000000000000000000000000 Inexact Rounded
  477. dqadd6500 add 77e-32 -1 -> -0.99999999999999999999999999999923
  478. dqadd6501 add 77e-33 -1 -> -0.999999999999999999999999999999923
  479. dqadd6502 add 77e-34 -1 -> -0.9999999999999999999999999999999923
  480. dqadd6503 add 77e-35 -1 -> -0.9999999999999999999999999999999992 Inexact Rounded
  481. dqadd6504 add 77e-36 -1 -> -0.9999999999999999999999999999999999 Inexact Rounded
  482. dqadd6505 add 77e-37 -1 -> -1.000000000000000000000000000000000 Inexact Rounded
  483. dqadd6506 add 77e-99 -1 -> -1.000000000000000000000000000000000 Inexact Rounded
  484. dqadd6510 add 77e-32 -10 -> -9.99999999999999999999999999999923
  485. dqadd6511 add 77e-33 -10 -> -9.999999999999999999999999999999923
  486. dqadd6512 add 77e-34 -10 -> -9.999999999999999999999999999999992 Inexact Rounded
  487. dqadd6513 add 77e-35 -10 -> -9.999999999999999999999999999999999 Inexact Rounded
  488. dqadd6514 add 77e-36 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
  489. dqadd6515 add 77e-37 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
  490. dqadd6516 add 77e-99 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
  491. -- and some more residue effects and different roundings
  492. rounding: half_up
  493. dqadd6540 add '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
  494. dqadd6541 add '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
  495. dqadd6542 add '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
  496. dqadd6543 add '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
  497. dqadd6544 add '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
  498. dqadd6545 add '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
  499. dqadd6546 add '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
  500. dqadd6547 add '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
  501. dqadd6548 add '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded
  502. dqadd6549 add '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded
  503. dqadd6550 add '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded
  504. dqadd6551 add '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded
  505. dqadd6552 add '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded
  506. dqadd6553 add '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded
  507. dqadd6554 add '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded
  508. dqadd6555 add '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded
  509. dqadd6556 add '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
  510. dqadd6557 add '9876543219876543216543210123456789' 1.000000001 -> '9876543219876543216543210123456790' Inexact Rounded
  511. dqadd6558 add '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
  512. dqadd6559 add '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
  513. rounding: half_even
  514. dqadd6560 add '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
  515. dqadd6561 add '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
  516. dqadd6562 add '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
  517. dqadd6563 add '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
  518. dqadd6564 add '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
  519. dqadd6565 add '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
  520. dqadd6566 add '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
  521. dqadd6567 add '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
  522. dqadd6568 add '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded
  523. dqadd6569 add '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded
  524. dqadd6570 add '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded
  525. dqadd6571 add '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded
  526. dqadd6572 add '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded
  527. dqadd6573 add '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded
  528. dqadd6574 add '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded
  529. dqadd6575 add '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded
  530. dqadd6576 add '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
  531. dqadd6577 add '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded
  532. dqadd6578 add '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
  533. dqadd6579 add '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
  534. -- critical few with even bottom digit...
  535. dqadd7540 add '9876543219876543216543210123456788' 0.499999999 -> '9876543219876543216543210123456788' Inexact Rounded
  536. dqadd7541 add '9876543219876543216543210123456788' 0.5 -> '9876543219876543216543210123456788' Inexact Rounded
  537. dqadd7542 add '9876543219876543216543210123456788' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded
  538. rounding: down
  539. dqadd7550 add '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
  540. dqadd7551 add '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
  541. dqadd7552 add '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
  542. dqadd7553 add '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
  543. dqadd7554 add '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
  544. dqadd7555 add '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
  545. dqadd7556 add '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
  546. dqadd7557 add '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
  547. dqadd7558 add '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456789' Inexact Rounded
  548. dqadd7559 add '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded
  549. dqadd7560 add '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456789' Inexact Rounded
  550. dqadd7561 add '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456789' Inexact Rounded
  551. dqadd7562 add '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456789' Inexact Rounded
  552. dqadd7563 add '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456789' Inexact Rounded
  553. dqadd7564 add '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456789' Inexact Rounded
  554. dqadd7565 add '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456789' Inexact Rounded
  555. dqadd7566 add '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
  556. dqadd7567 add '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded
  557. dqadd7568 add '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
  558. dqadd7569 add '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
  559. -- more zeros, etc.
  560. rounding: half_even
  561. dqadd7701 add 5.00 1.00E-3 -> 5.00100
  562. dqadd7702 add 00.00 0.000 -> 0.000
  563. dqadd7703 add 00.00 0E-3 -> 0.000
  564. dqadd7704 add 0E-3 00.00 -> 0.000
  565. dqadd7710 add 0E+3 00.00 -> 0.00
  566. dqadd7711 add 0E+3 00.0 -> 0.0
  567. dqadd7712 add 0E+3 00. -> 0
  568. dqadd7713 add 0E+3 00.E+1 -> 0E+1
  569. dqadd7714 add 0E+3 00.E+2 -> 0E+2
  570. dqadd7715 add 0E+3 00.E+3 -> 0E+3
  571. dqadd7716 add 0E+3 00.E+4 -> 0E+3
  572. dqadd7717 add 0E+3 00.E+5 -> 0E+3
  573. dqadd7718 add 0E+3 -00.0 -> 0.0
  574. dqadd7719 add 0E+3 -00. -> 0
  575. dqadd7731 add 0E+3 -00.E+1 -> 0E+1
  576. dqadd7720 add 00.00 0E+3 -> 0.00
  577. dqadd7721 add 00.0 0E+3 -> 0.0
  578. dqadd7722 add 00. 0E+3 -> 0
  579. dqadd7723 add 00.E+1 0E+3 -> 0E+1
  580. dqadd7724 add 00.E+2 0E+3 -> 0E+2
  581. dqadd7725 add 00.E+3 0E+3 -> 0E+3
  582. dqadd7726 add 00.E+4 0E+3 -> 0E+3
  583. dqadd7727 add 00.E+5 0E+3 -> 0E+3
  584. dqadd7728 add -00.00 0E+3 -> 0.00
  585. dqadd7729 add -00.0 0E+3 -> 0.0
  586. dqadd7730 add -00. 0E+3 -> 0
  587. dqadd7732 add 0 0 -> 0
  588. dqadd7733 add 0 -0 -> 0
  589. dqadd7734 add -0 0 -> 0
  590. dqadd7735 add -0 -0 -> -0 -- IEEE 754 special case
  591. dqadd7736 add 1 -1 -> 0
  592. dqadd7737 add -1 -1 -> -2
  593. dqadd7738 add 1 1 -> 2
  594. dqadd7739 add -1 1 -> 0
  595. dqadd7741 add 0 -1 -> -1
  596. dqadd7742 add -0 -1 -> -1
  597. dqadd7743 add 0 1 -> 1
  598. dqadd7744 add -0 1 -> 1
  599. dqadd7745 add -1 0 -> -1
  600. dqadd7746 add -1 -0 -> -1
  601. dqadd7747 add 1 0 -> 1
  602. dqadd7748 add 1 -0 -> 1
  603. dqadd7751 add 0.0 -1 -> -1.0
  604. dqadd7752 add -0.0 -1 -> -1.0
  605. dqadd7753 add 0.0 1 -> 1.0
  606. dqadd7754 add -0.0 1 -> 1.0
  607. dqadd7755 add -1.0 0 -> -1.0
  608. dqadd7756 add -1.0 -0 -> -1.0
  609. dqadd7757 add 1.0 0 -> 1.0
  610. dqadd7758 add 1.0 -0 -> 1.0
  611. dqadd7761 add 0 -1.0 -> -1.0
  612. dqadd7762 add -0 -1.0 -> -1.0
  613. dqadd7763 add 0 1.0 -> 1.0
  614. dqadd7764 add -0 1.0 -> 1.0
  615. dqadd7765 add -1 0.0 -> -1.0
  616. dqadd7766 add -1 -0.0 -> -1.0
  617. dqadd7767 add 1 0.0 -> 1.0
  618. dqadd7768 add 1 -0.0 -> 1.0
  619. dqadd7771 add 0.0 -1.0 -> -1.0
  620. dqadd7772 add -0.0 -1.0 -> -1.0
  621. dqadd7773 add 0.0 1.0 -> 1.0
  622. dqadd7774 add -0.0 1.0 -> 1.0
  623. dqadd7775 add -1.0 0.0 -> -1.0
  624. dqadd7776 add -1.0 -0.0 -> -1.0
  625. dqadd7777 add 1.0 0.0 -> 1.0
  626. dqadd7778 add 1.0 -0.0 -> 1.0
  627. -- Specials
  628. dqadd7780 add -Inf -Inf -> -Infinity
  629. dqadd7781 add -Inf -1000 -> -Infinity
  630. dqadd7782 add -Inf -1 -> -Infinity
  631. dqadd7783 add -Inf -0 -> -Infinity
  632. dqadd7784 add -Inf 0 -> -Infinity
  633. dqadd7785 add -Inf 1 -> -Infinity
  634. dqadd7786 add -Inf 1000 -> -Infinity
  635. dqadd7787 add -1000 -Inf -> -Infinity
  636. dqadd7788 add -Inf -Inf -> -Infinity
  637. dqadd7789 add -1 -Inf -> -Infinity
  638. dqadd7790 add -0 -Inf -> -Infinity
  639. dqadd7791 add 0 -Inf -> -Infinity
  640. dqadd7792 add 1 -Inf -> -Infinity
  641. dqadd7793 add 1000 -Inf -> -Infinity
  642. dqadd7794 add Inf -Inf -> NaN Invalid_operation
  643. dqadd7800 add Inf -Inf -> NaN Invalid_operation
  644. dqadd7801 add Inf -1000 -> Infinity
  645. dqadd7802 add Inf -1 -> Infinity
  646. dqadd7803 add Inf -0 -> Infinity
  647. dqadd7804 add Inf 0 -> Infinity
  648. dqadd7805 add Inf 1 -> Infinity
  649. dqadd7806 add Inf 1000 -> Infinity
  650. dqadd7807 add Inf Inf -> Infinity
  651. dqadd7808 add -1000 Inf -> Infinity
  652. dqadd7809 add -Inf Inf -> NaN Invalid_operation
  653. dqadd7810 add -1 Inf -> Infinity
  654. dqadd7811 add -0 Inf -> Infinity
  655. dqadd7812 add 0 Inf -> Infinity
  656. dqadd7813 add 1 Inf -> Infinity
  657. dqadd7814 add 1000 Inf -> Infinity
  658. dqadd7815 add Inf Inf -> Infinity
  659. dqadd7821 add NaN -Inf -> NaN
  660. dqadd7822 add NaN -1000 -> NaN
  661. dqadd7823 add NaN -1 -> NaN
  662. dqadd7824 add NaN -0 -> NaN
  663. dqadd7825 add NaN 0 -> NaN
  664. dqadd7826 add NaN 1 -> NaN
  665. dqadd7827 add NaN 1000 -> NaN
  666. dqadd7828 add NaN Inf -> NaN
  667. dqadd7829 add NaN NaN -> NaN
  668. dqadd7830 add -Inf NaN -> NaN
  669. dqadd7831 add -1000 NaN -> NaN
  670. dqadd7832 add -1 NaN -> NaN
  671. dqadd7833 add -0 NaN -> NaN
  672. dqadd7834 add 0 NaN -> NaN
  673. dqadd7835 add 1 NaN -> NaN
  674. dqadd7836 add 1000 NaN -> NaN
  675. dqadd7837 add Inf NaN -> NaN
  676. dqadd7841 add sNaN -Inf -> NaN Invalid_operation
  677. dqadd7842 add sNaN -1000 -> NaN Invalid_operation
  678. dqadd7843 add sNaN -1 -> NaN Invalid_operation
  679. dqadd7844 add sNaN -0 -> NaN Invalid_operation
  680. dqadd7845 add sNaN 0 -> NaN Invalid_operation
  681. dqadd7846 add sNaN 1 -> NaN Invalid_operation
  682. dqadd7847 add sNaN 1000 -> NaN Invalid_operation
  683. dqadd7848 add sNaN NaN -> NaN Invalid_operation
  684. dqadd7849 add sNaN sNaN -> NaN Invalid_operation
  685. dqadd7850 add NaN sNaN -> NaN Invalid_operation
  686. dqadd7851 add -Inf sNaN -> NaN Invalid_operation
  687. dqadd7852 add -1000 sNaN -> NaN Invalid_operation
  688. dqadd7853 add -1 sNaN -> NaN Invalid_operation
  689. dqadd7854 add -0 sNaN -> NaN Invalid_operation
  690. dqadd7855 add 0 sNaN -> NaN Invalid_operation
  691. dqadd7856 add 1 sNaN -> NaN Invalid_operation
  692. dqadd7857 add 1000 sNaN -> NaN Invalid_operation
  693. dqadd7858 add Inf sNaN -> NaN Invalid_operation
  694. dqadd7859 add NaN sNaN -> NaN Invalid_operation
  695. -- propagating NaNs
  696. dqadd7861 add NaN1 -Inf -> NaN1
  697. dqadd7862 add +NaN2 -1000 -> NaN2
  698. dqadd7863 add NaN3 1000 -> NaN3
  699. dqadd7864 add NaN4 Inf -> NaN4
  700. dqadd7865 add NaN5 +NaN6 -> NaN5
  701. dqadd7866 add -Inf NaN7 -> NaN7
  702. dqadd7867 add -1000 NaN8 -> NaN8
  703. dqadd7868 add 1000 NaN9 -> NaN9
  704. dqadd7869 add Inf +NaN10 -> NaN10
  705. dqadd7871 add sNaN11 -Inf -> NaN11 Invalid_operation
  706. dqadd7872 add sNaN12 -1000 -> NaN12 Invalid_operation
  707. dqadd7873 add sNaN13 1000 -> NaN13 Invalid_operation
  708. dqadd7874 add sNaN14 NaN17 -> NaN14 Invalid_operation
  709. dqadd7875 add sNaN15 sNaN18 -> NaN15 Invalid_operation
  710. dqadd7876 add NaN16 sNaN19 -> NaN19 Invalid_operation
  711. dqadd7877 add -Inf +sNaN20 -> NaN20 Invalid_operation
  712. dqadd7878 add -1000 sNaN21 -> NaN21 Invalid_operation
  713. dqadd7879 add 1000 sNaN22 -> NaN22 Invalid_operation
  714. dqadd7880 add Inf sNaN23 -> NaN23 Invalid_operation
  715. dqadd7881 add +NaN25 +sNaN24 -> NaN24 Invalid_operation
  716. dqadd7882 add -NaN26 NaN28 -> -NaN26
  717. dqadd7883 add -sNaN27 sNaN29 -> -NaN27 Invalid_operation
  718. dqadd7884 add 1000 -NaN30 -> -NaN30
  719. dqadd7885 add 1000 -sNaN31 -> -NaN31 Invalid_operation
  720. -- Here we explore near the boundary of rounding a subnormal to Nmin
  721. dqadd7575 add 1E-6143 -1E-6176 -> 9.99999999999999999999999999999999E-6144 Subnormal
  722. dqadd7576 add -1E-6143 +1E-6176 -> -9.99999999999999999999999999999999E-6144 Subnormal
  723. -- check overflow edge case
  724. -- 1234567890123456
  725. dqadd7972 apply 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
  726. dqadd7973 add 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
  727. dqadd7974 add 9999999999999999999999999999999999E+6111 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
  728. dqadd7975 add 9999999999999999999999999999999999E+6111 1E+6111 -> Infinity Overflow Inexact Rounded
  729. dqadd7976 add 9999999999999999999999999999999999E+6111 9E+6110 -> Infinity Overflow Inexact Rounded
  730. dqadd7977 add 9999999999999999999999999999999999E+6111 8E+6110 -> Infinity Overflow Inexact Rounded
  731. dqadd7978 add 9999999999999999999999999999999999E+6111 7E+6110 -> Infinity Overflow Inexact Rounded
  732. dqadd7979 add 9999999999999999999999999999999999E+6111 6E+6110 -> Infinity Overflow Inexact Rounded
  733. dqadd7980 add 9999999999999999999999999999999999E+6111 5E+6110 -> Infinity Overflow Inexact Rounded
  734. dqadd7981 add 9999999999999999999999999999999999E+6111 4E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
  735. dqadd7982 add 9999999999999999999999999999999999E+6111 3E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
  736. dqadd7983 add 9999999999999999999999999999999999E+6111 2E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
  737. dqadd7984 add 9999999999999999999999999999999999E+6111 1E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
  738. dqadd7985 apply -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
  739. dqadd7986 add -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
  740. dqadd7987 add -9999999999999999999999999999999999E+6111 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
  741. dqadd7988 add -9999999999999999999999999999999999E+6111 -1E+6111 -> -Infinity Overflow Inexact Rounded
  742. dqadd7989 add -9999999999999999999999999999999999E+6111 -9E+6110 -> -Infinity Overflow Inexact Rounded
  743. dqadd7990 add -9999999999999999999999999999999999E+6111 -8E+6110 -> -Infinity Overflow Inexact Rounded
  744. dqadd7991 add -9999999999999999999999999999999999E+6111 -7E+6110 -> -Infinity Overflow Inexact Rounded
  745. dqadd7992 add -9999999999999999999999999999999999E+6111 -6E+6110 -> -Infinity Overflow Inexact Rounded
  746. dqadd7993 add -9999999999999999999999999999999999E+6111 -5E+6110 -> -Infinity Overflow Inexact Rounded
  747. dqadd7994 add -9999999999999999999999999999999999E+6111 -4E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
  748. dqadd7995 add -9999999999999999999999999999999999E+6111 -3E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
  749. dqadd7996 add -9999999999999999999999999999999999E+6111 -2E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
  750. dqadd7997 add -9999999999999999999999999999999999E+6111 -1E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
  751. -- And for round down full and subnormal results
  752. rounding: down
  753. dqadd71100 add 1e+2 -1e-6143 -> 99.99999999999999999999999999999999 Rounded Inexact
  754. dqadd71101 add 1e+1 -1e-6143 -> 9.999999999999999999999999999999999 Rounded Inexact
  755. dqadd71103 add +1 -1e-6143 -> 0.9999999999999999999999999999999999 Rounded Inexact
  756. dqadd71104 add 1e-1 -1e-6143 -> 0.09999999999999999999999999999999999 Rounded Inexact
  757. dqadd71105 add 1e-2 -1e-6143 -> 0.009999999999999999999999999999999999 Rounded Inexact
  758. dqadd71106 add 1e-3 -1e-6143 -> 0.0009999999999999999999999999999999999 Rounded Inexact
  759. dqadd71107 add 1e-4 -1e-6143 -> 0.00009999999999999999999999999999999999 Rounded Inexact
  760. dqadd71108 add 1e-5 -1e-6143 -> 0.000009999999999999999999999999999999999 Rounded Inexact
  761. dqadd71109 add 1e-6 -1e-6143 -> 9.999999999999999999999999999999999E-7 Rounded Inexact
  762. rounding: ceiling
  763. dqadd71110 add -1e+2 +1e-6143 -> -99.99999999999999999999999999999999 Rounded Inexact
  764. dqadd71111 add -1e+1 +1e-6143 -> -9.999999999999999999999999999999999 Rounded Inexact
  765. dqadd71113 add -1 +1e-6143 -> -0.9999999999999999999999999999999999 Rounded Inexact
  766. dqadd71114 add -1e-1 +1e-6143 -> -0.09999999999999999999999999999999999 Rounded Inexact
  767. dqadd71115 add -1e-2 +1e-6143 -> -0.009999999999999999999999999999999999 Rounded Inexact
  768. dqadd71116 add -1e-3 +1e-6143 -> -0.0009999999999999999999999999999999999 Rounded Inexact
  769. dqadd71117 add -1e-4 +1e-6143 -> -0.00009999999999999999999999999999999999 Rounded Inexact
  770. dqadd71118 add -1e-5 +1e-6143 -> -0.000009999999999999999999999999999999999 Rounded Inexact
  771. dqadd71119 add -1e-6 +1e-6143 -> -9.999999999999999999999999999999999E-7 Rounded Inexact
  772. -- tests based on Gunnar Degnbol's edge case
  773. rounding: half_even
  774. dqadd71300 add 1E34 -0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  775. dqadd71310 add 1E34 -0.51 -> 9999999999999999999999999999999999 Inexact Rounded
  776. dqadd71311 add 1E34 -0.501 -> 9999999999999999999999999999999999 Inexact Rounded
  777. dqadd71312 add 1E34 -0.5001 -> 9999999999999999999999999999999999 Inexact Rounded
  778. dqadd71313 add 1E34 -0.50001 -> 9999999999999999999999999999999999 Inexact Rounded
  779. dqadd71314 add 1E34 -0.500001 -> 9999999999999999999999999999999999 Inexact Rounded
  780. dqadd71315 add 1E34 -0.5000001 -> 9999999999999999999999999999999999 Inexact Rounded
  781. dqadd71316 add 1E34 -0.50000001 -> 9999999999999999999999999999999999 Inexact Rounded
  782. dqadd71317 add 1E34 -0.500000001 -> 9999999999999999999999999999999999 Inexact Rounded
  783. dqadd71318 add 1E34 -0.5000000001 -> 9999999999999999999999999999999999 Inexact Rounded
  784. dqadd71319 add 1E34 -0.50000000001 -> 9999999999999999999999999999999999 Inexact Rounded
  785. dqadd71320 add 1E34 -0.500000000001 -> 9999999999999999999999999999999999 Inexact Rounded
  786. dqadd71321 add 1E34 -0.5000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
  787. dqadd71322 add 1E34 -0.50000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
  788. dqadd71323 add 1E34 -0.500000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
  789. dqadd71324 add 1E34 -0.5000000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
  790. dqadd71325 add 1E34 -0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  791. dqadd71326 add 1E34 -0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  792. dqadd71327 add 1E34 -0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  793. dqadd71328 add 1E34 -0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  794. dqadd71329 add 1E34 -0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  795. dqadd71330 add 1E34 -0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  796. dqadd71331 add 1E34 -0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  797. dqadd71332 add 1E34 -0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  798. dqadd71333 add 1E34 -0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  799. dqadd71334 add 1E34 -0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  800. dqadd71335 add 1E34 -0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  801. dqadd71336 add 1E34 -0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  802. dqadd71337 add 1E34 -0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  803. dqadd71338 add 1E34 -0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  804. dqadd71339 add 1E34 -0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  805. dqadd71340 add 1E34 -5000000.000010001 -> 9999999999999999999999999995000000 Inexact Rounded
  806. dqadd71341 add 1E34 -5000000.000000001 -> 9999999999999999999999999995000000 Inexact Rounded
  807. dqadd71349 add 9999999999999999999999999999999999 0.4 -> 9999999999999999999999999999999999 Inexact Rounded
  808. dqadd71350 add 9999999999999999999999999999999999 0.49 -> 9999999999999999999999999999999999 Inexact Rounded
  809. dqadd71351 add 9999999999999999999999999999999999 0.499 -> 9999999999999999999999999999999999 Inexact Rounded
  810. dqadd71352 add 9999999999999999999999999999999999 0.4999 -> 9999999999999999999999999999999999 Inexact Rounded
  811. dqadd71353 add 9999999999999999999999999999999999 0.49999 -> 9999999999999999999999999999999999 Inexact Rounded
  812. dqadd71354 add 9999999999999999999999999999999999 0.499999 -> 9999999999999999999999999999999999 Inexact Rounded
  813. dqadd71355 add 9999999999999999999999999999999999 0.4999999 -> 9999999999999999999999999999999999 Inexact Rounded
  814. dqadd71356 add 9999999999999999999999999999999999 0.49999999 -> 9999999999999999999999999999999999 Inexact Rounded
  815. dqadd71357 add 9999999999999999999999999999999999 0.499999999 -> 9999999999999999999999999999999999 Inexact Rounded
  816. dqadd71358 add 9999999999999999999999999999999999 0.4999999999 -> 9999999999999999999999999999999999 Inexact Rounded
  817. dqadd71359 add 9999999999999999999999999999999999 0.49999999999 -> 9999999999999999999999999999999999 Inexact Rounded
  818. dqadd71360 add 9999999999999999999999999999999999 0.499999999999 -> 9999999999999999999999999999999999 Inexact Rounded
  819. dqadd71361 add 9999999999999999999999999999999999 0.4999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
  820. dqadd71362 add 9999999999999999999999999999999999 0.49999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
  821. dqadd71363 add 9999999999999999999999999999999999 0.499999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
  822. dqadd71364 add 9999999999999999999999999999999999 0.4999999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
  823. dqadd71365 add 9999999999999999999999999999999999 0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  824. dqadd71367 add 9999999999999999999999999999999999 0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  825. dqadd71368 add 9999999999999999999999999999999999 0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  826. dqadd71369 add 9999999999999999999999999999999999 0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  827. dqadd71370 add 9999999999999999999999999999999999 0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  828. dqadd71371 add 9999999999999999999999999999999999 0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  829. dqadd71372 add 9999999999999999999999999999999999 0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  830. dqadd71373 add 9999999999999999999999999999999999 0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  831. dqadd71374 add 9999999999999999999999999999999999 0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  832. dqadd71375 add 9999999999999999999999999999999999 0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  833. dqadd71376 add 9999999999999999999999999999999999 0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  834. dqadd71377 add 9999999999999999999999999999999999 0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  835. dqadd71378 add 9999999999999999999999999999999999 0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  836. dqadd71379 add 9999999999999999999999999999999999 0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  837. dqadd71380 add 9999999999999999999999999999999999 0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  838. dqadd71381 add 9999999999999999999999999999999999 0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  839. dqadd71382 add 9999999999999999999999999999999999 0.5000000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  840. dqadd71383 add 9999999999999999999999999999999999 0.500000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  841. dqadd71384 add 9999999999999999999999999999999999 0.50000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  842. dqadd71385 add 9999999999999999999999999999999999 0.5000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  843. dqadd71386 add 9999999999999999999999999999999999 0.500000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  844. dqadd71387 add 9999999999999999999999999999999999 0.50000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  845. dqadd71388 add 9999999999999999999999999999999999 0.5000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  846. dqadd71389 add 9999999999999999999999999999999999 0.500000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  847. dqadd71390 add 9999999999999999999999999999999999 0.50000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  848. dqadd71391 add 9999999999999999999999999999999999 0.5000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  849. dqadd71392 add 9999999999999999999999999999999999 0.500001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  850. dqadd71393 add 9999999999999999999999999999999999 0.50001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  851. dqadd71394 add 9999999999999999999999999999999999 0.5001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  852. dqadd71395 add 9999999999999999999999999999999999 0.501 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  853. dqadd71396 add 9999999999999999999999999999999999 0.51 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
  854. -- More GD edge cases, where difference between the unadjusted
  855. -- exponents is larger than the maximum precision and one side is 0
  856. dqadd71420 add 0 1.123456789987654321123456789012345 -> 1.123456789987654321123456789012345
  857. dqadd71421 add 0 1.123456789987654321123456789012345E-1 -> 0.1123456789987654321123456789012345
  858. dqadd71422 add 0 1.123456789987654321123456789012345E-2 -> 0.01123456789987654321123456789012345
  859. dqadd71423 add 0 1.123456789987654321123456789012345E-3 -> 0.001123456789987654321123456789012345
  860. dqadd71424 add 0 1.123456789987654321123456789012345E-4 -> 0.0001123456789987654321123456789012345
  861. dqadd71425 add 0 1.123456789987654321123456789012345E-5 -> 0.00001123456789987654321123456789012345
  862. dqadd71426 add 0 1.123456789987654321123456789012345E-6 -> 0.000001123456789987654321123456789012345
  863. dqadd71427 add 0 1.123456789987654321123456789012345E-7 -> 1.123456789987654321123456789012345E-7
  864. dqadd71428 add 0 1.123456789987654321123456789012345E-8 -> 1.123456789987654321123456789012345E-8
  865. dqadd71429 add 0 1.123456789987654321123456789012345E-9 -> 1.123456789987654321123456789012345E-9
  866. dqadd71430 add 0 1.123456789987654321123456789012345E-10 -> 1.123456789987654321123456789012345E-10
  867. dqadd71431 add 0 1.123456789987654321123456789012345E-11 -> 1.123456789987654321123456789012345E-11
  868. dqadd71432 add 0 1.123456789987654321123456789012345E-12 -> 1.123456789987654321123456789012345E-12
  869. dqadd71433 add 0 1.123456789987654321123456789012345E-13 -> 1.123456789987654321123456789012345E-13
  870. dqadd71434 add 0 1.123456789987654321123456789012345E-14 -> 1.123456789987654321123456789012345E-14
  871. dqadd71435 add 0 1.123456789987654321123456789012345E-15 -> 1.123456789987654321123456789012345E-15
  872. dqadd71436 add 0 1.123456789987654321123456789012345E-16 -> 1.123456789987654321123456789012345E-16
  873. dqadd71437 add 0 1.123456789987654321123456789012345E-17 -> 1.123456789987654321123456789012345E-17
  874. dqadd71438 add 0 1.123456789987654321123456789012345E-18 -> 1.123456789987654321123456789012345E-18
  875. dqadd71439 add 0 1.123456789987654321123456789012345E-19 -> 1.123456789987654321123456789012345E-19
  876. dqadd71440 add 0 1.123456789987654321123456789012345E-20 -> 1.123456789987654321123456789012345E-20
  877. dqadd71441 add 0 1.123456789987654321123456789012345E-21 -> 1.123456789987654321123456789012345E-21
  878. dqadd71442 add 0 1.123456789987654321123456789012345E-22 -> 1.123456789987654321123456789012345E-22
  879. dqadd71443 add 0 1.123456789987654321123456789012345E-23 -> 1.123456789987654321123456789012345E-23
  880. dqadd71444 add 0 1.123456789987654321123456789012345E-24 -> 1.123456789987654321123456789012345E-24
  881. dqadd71445 add 0 1.123456789987654321123456789012345E-25 -> 1.123456789987654321123456789012345E-25
  882. dqadd71446 add 0 1.123456789987654321123456789012345E-26 -> 1.123456789987654321123456789012345E-26
  883. dqadd71447 add 0 1.123456789987654321123456789012345E-27 -> 1.123456789987654321123456789012345E-27
  884. dqadd71448 add 0 1.123456789987654321123456789012345E-28 -> 1.123456789987654321123456789012345E-28
  885. dqadd71449 add 0 1.123456789987654321123456789012345E-29 -> 1.123456789987654321123456789012345E-29
  886. dqadd71450 add 0 1.123456789987654321123456789012345E-30 -> 1.123456789987654321123456789012345E-30
  887. dqadd71451 add 0 1.123456789987654321123456789012345E-31 -> 1.123456789987654321123456789012345E-31
  888. dqadd71452 add 0 1.123456789987654321123456789012345E-32 -> 1.123456789987654321123456789012345E-32
  889. dqadd71453 add 0 1.123456789987654321123456789012345E-33 -> 1.123456789987654321123456789012345E-33
  890. dqadd71454 add 0 1.123456789987654321123456789012345E-34 -> 1.123456789987654321123456789012345E-34
  891. dqadd71455 add 0 1.123456789987654321123456789012345E-35 -> 1.123456789987654321123456789012345E-35
  892. dqadd71456 add 0 1.123456789987654321123456789012345E-36 -> 1.123456789987654321123456789012345E-36
  893. -- same, reversed 0
  894. dqadd71460 add 1.123456789987654321123456789012345 0 -> 1.123456789987654321123456789012345
  895. dqadd71461 add 1.123456789987654321123456789012345E-1 0 -> 0.1123456789987654321123456789012345
  896. dqadd71462 add 1.123456789987654321123456789012345E-2 0 -> 0.01123456789987654321123456789012345
  897. dqadd71463 add 1.123456789987654321123456789012345E-3 0 -> 0.001123456789987654321123456789012345
  898. dqadd71464 add 1.123456789987654321123456789012345E-4 0 -> 0.0001123456789987654321123456789012345
  899. dqadd71465 add 1.123456789987654321123456789012345E-5 0 -> 0.00001123456789987654321123456789012345
  900. dqadd71466 add 1.123456789987654321123456789012345E-6 0 -> 0.000001123456789987654321123456789012345
  901. dqadd71467 add 1.123456789987654321123456789012345E-7 0 -> 1.123456789987654321123456789012345E-7
  902. dqadd71468 add 1.123456789987654321123456789012345E-8 0 -> 1.123456789987654321123456789012345E-8
  903. dqadd71469 add 1.123456789987654321123456789012345E-9 0 -> 1.123456789987654321123456789012345E-9
  904. dqadd71470 add 1.123456789987654321123456789012345E-10 0 -> 1.123456789987654321123456789012345E-10
  905. dqadd71471 add 1.123456789987654321123456789012345E-11 0 -> 1.123456789987654321123456789012345E-11
  906. dqadd71472 add 1.123456789987654321123456789012345E-12 0 -> 1.123456789987654321123456789012345E-12
  907. dqadd71473 add 1.123456789987654321123456789012345E-13 0 -> 1.123456789987654321123456789012345E-13
  908. dqadd71474 add 1.123456789987654321123456789012345E-14 0 -> 1.123456789987654321123456789012345E-14
  909. dqadd71475 add 1.123456789987654321123456789012345E-15 0 -> 1.123456789987654321123456789012345E-15
  910. dqadd71476 add 1.123456789987654321123456789012345E-16 0 -> 1.123456789987654321123456789012345E-16
  911. dqadd71477 add 1.123456789987654321123456789012345E-17 0 -> 1.123456789987654321123456789012345E-17
  912. dqadd71478 add 1.123456789987654321123456789012345E-18 0 -> 1.123456789987654321123456789012345E-18
  913. dqadd71479 add 1.123456789987654321123456789012345E-19 0 -> 1.123456789987654321123456789012345E-19
  914. dqadd71480 add 1.123456789987654321123456789012345E-20 0 -> 1.123456789987654321123456789012345E-20
  915. dqadd71481 add 1.123456789987654321123456789012345E-21 0 -> 1.123456789987654321123456789012345E-21
  916. dqadd71482 add 1.123456789987654321123456789012345E-22 0 -> 1.123456789987654321123456789012345E-22
  917. dqadd71483 add 1.123456789987654321123456789012345E-23 0 -> 1.123456789987654321123456789012345E-23
  918. dqadd71484 add 1.123456789987654321123456789012345E-24 0 -> 1.123456789987654321123456789012345E-24
  919. dqadd71485 add 1.123456789987654321123456789012345E-25 0 -> 1.123456789987654321123456789012345E-25
  920. dqadd71486 add 1.123456789987654321123456789012345E-26 0 -> 1.123456789987654321123456789012345E-26
  921. dqadd71487 add 1.123456789987654321123456789012345E-27 0 -> 1.123456789987654321123456789012345E-27
  922. dqadd71488 add 1.123456789987654321123456789012345E-28 0 -> 1.123456789987654321123456789012345E-28
  923. dqadd71489 add 1.123456789987654321123456789012345E-29 0 -> 1.123456789987654321123456789012345E-29
  924. dqadd71490 add 1.123456789987654321123456789012345E-30 0 -> 1.123456789987654321123456789012345E-30
  925. dqadd71491 add 1.123456789987654321123456789012345E-31 0 -> 1.123456789987654321123456789012345E-31
  926. dqadd71492 add 1.123456789987654321123456789012345E-32 0 -> 1.123456789987654321123456789012345E-32
  927. dqadd71493 add 1.123456789987654321123456789012345E-33 0 -> 1.123456789987654321123456789012345E-33
  928. dqadd71494 add 1.123456789987654321123456789012345E-34 0 -> 1.123456789987654321123456789012345E-34
  929. dqadd71495 add 1.123456789987654321123456789012345E-35 0 -> 1.123456789987654321123456789012345E-35
  930. dqadd71496 add 1.123456789987654321123456789012345E-36 0 -> 1.123456789987654321123456789012345E-36
  931. -- same, Es on the 0
  932. dqadd71500 add 1.123456789987654321123456789012345 0E-0 -> 1.123456789987654321123456789012345
  933. dqadd71501 add 1.123456789987654321123456789012345 0E-1 -> 1.123456789987654321123456789012345
  934. dqadd71502 add 1.123456789987654321123456789012345 0E-2 -> 1.123456789987654321123456789012345
  935. dqadd71503 add 1.123456789987654321123456789012345 0E-3 -> 1.123456789987654321123456789012345
  936. dqadd71504 add 1.123456789987654321123456789012345 0E-4 -> 1.123456789987654321123456789012345
  937. dqadd71505 add 1.123456789987654321123456789012345 0E-5 -> 1.123456789987654321123456789012345
  938. dqadd71506 add 1.123456789987654321123456789012345 0E-6 -> 1.123456789987654321123456789012345
  939. dqadd71507 add 1.123456789987654321123456789012345 0E-7 -> 1.123456789987654321123456789012345
  940. dqadd71508 add 1.123456789987654321123456789012345 0E-8 -> 1.123456789987654321123456789012345
  941. dqadd71509 add 1.123456789987654321123456789012345 0E-9 -> 1.123456789987654321123456789012345
  942. dqadd71510 add 1.123456789987654321123456789012345 0E-10 -> 1.123456789987654321123456789012345
  943. dqadd71511 add 1.123456789987654321123456789012345 0E-11 -> 1.123456789987654321123456789012345
  944. dqadd71512 add 1.123456789987654321123456789012345 0E-12 -> 1.123456789987654321123456789012345
  945. dqadd71513 add 1.123456789987654321123456789012345 0E-13 -> 1.123456789987654321123456789012345
  946. dqadd71514 add 1.123456789987654321123456789012345 0E-14 -> 1.123456789987654321123456789012345
  947. dqadd71515 add 1.123456789987654321123456789012345 0E-15 -> 1.123456789987654321123456789012345
  948. dqadd71516 add 1.123456789987654321123456789012345 0E-16 -> 1.123456789987654321123456789012345
  949. dqadd71517 add 1.123456789987654321123456789012345 0E-17 -> 1.123456789987654321123456789012345
  950. dqadd71518 add 1.123456789987654321123456789012345 0E-18 -> 1.123456789987654321123456789012345
  951. dqadd71519 add 1.123456789987654321123456789012345 0E-19 -> 1.123456789987654321123456789012345
  952. dqadd71520 add 1.123456789987654321123456789012345 0E-20 -> 1.123456789987654321123456789012345
  953. dqadd71521 add 1.123456789987654321123456789012345 0E-21 -> 1.123456789987654321123456789012345
  954. dqadd71522 add 1.123456789987654321123456789012345 0E-22 -> 1.123456789987654321123456789012345
  955. dqadd71523 add 1.123456789987654321123456789012345 0E-23 -> 1.123456789987654321123456789012345
  956. dqadd71524 add 1.123456789987654321123456789012345 0E-24 -> 1.123456789987654321123456789012345
  957. dqadd71525 add 1.123456789987654321123456789012345 0E-25 -> 1.123456789987654321123456789012345
  958. dqadd71526 add 1.123456789987654321123456789012345 0E-26 -> 1.123456789987654321123456789012345
  959. dqadd71527 add 1.123456789987654321123456789012345 0E-27 -> 1.123456789987654321123456789012345
  960. dqadd71528 add 1.123456789987654321123456789012345 0E-28 -> 1.123456789987654321123456789012345
  961. dqadd71529 add 1.123456789987654321123456789012345 0E-29 -> 1.123456789987654321123456789012345
  962. dqadd71530 add 1.123456789987654321123456789012345 0E-30 -> 1.123456789987654321123456789012345
  963. dqadd71531 add 1.123456789987654321123456789012345 0E-31 -> 1.123456789987654321123456789012345
  964. dqadd71532 add 1.123456789987654321123456789012345 0E-32 -> 1.123456789987654321123456789012345
  965. dqadd71533 add 1.123456789987654321123456789012345 0E-33 -> 1.123456789987654321123456789012345
  966. -- next four flag Rounded because the 0 extends the result
  967. dqadd71534 add 1.123456789987654321123456789012345 0E-34 -> 1.123456789987654321123456789012345 Rounded
  968. dqadd71535 add 1.123456789987654321123456789012345 0E-35 -> 1.123456789987654321123456789012345 Rounded
  969. dqadd71536 add 1.123456789987654321123456789012345 0E-36 -> 1.123456789987654321123456789012345 Rounded
  970. dqadd71537 add 1.123456789987654321123456789012345 0E-37 -> 1.123456789987654321123456789012345 Rounded
  971. -- sum of two opposite-sign operands is exactly 0 and floor => -0
  972. rounding: half_up
  973. -- exact zeros from zeros
  974. dqadd71600 add 0 0E-19 -> 0E-19
  975. dqadd71601 add -0 0E-19 -> 0E-19
  976. dqadd71602 add 0 -0E-19 -> 0E-19
  977. dqadd71603 add -0 -0E-19 -> -0E-19
  978. -- exact zeros from non-zeros
  979. dqadd71611 add -11 11 -> 0
  980. dqadd71612 add 11 -11 -> 0
  981. rounding: half_down
  982. -- exact zeros from zeros
  983. dqadd71620 add 0 0E-19 -> 0E-19
  984. dqadd71621 add -0 0E-19 -> 0E-19
  985. dqadd71622 add 0 -0E-19 -> 0E-19
  986. dqadd71623 add -0 -0E-19 -> -0E-19
  987. -- exact zeros from non-zeros
  988. dqadd71631 add -11 11 -> 0
  989. dqadd71632 add 11 -11 -> 0
  990. rounding: half_even
  991. -- exact zeros from zeros
  992. dqadd71640 add 0 0E-19 -> 0E-19
  993. dqadd71641 add -0 0E-19 -> 0E-19
  994. dqadd71642 add 0 -0E-19 -> 0E-19
  995. dqadd71643 add -0 -0E-19 -> -0E-19
  996. -- exact zeros from non-zeros
  997. dqadd71651 add -11 11 -> 0
  998. dqadd71652 add 11 -11 -> 0
  999. rounding: up
  1000. -- exact zeros from zeros
  1001. dqadd71660 add 0 0E-19 -> 0E-19
  1002. dqadd71661 add -0 0E-19 -> 0E-19
  1003. dqadd71662 add 0 -0E-19 -> 0E-19
  1004. dqadd71663 add -0 -0E-19 -> -0E-19
  1005. -- exact zeros from non-zeros
  1006. dqadd71671 add -11 11 -> 0
  1007. dqadd71672 add 11 -11 -> 0
  1008. rounding: down
  1009. -- exact zeros from zeros
  1010. dqadd71680 add 0 0E-19 -> 0E-19
  1011. dqadd71681 add -0 0E-19 -> 0E-19
  1012. dqadd71682 add 0 -0E-19 -> 0E-19
  1013. dqadd71683 add -0 -0E-19 -> -0E-19
  1014. -- exact zeros from non-zeros
  1015. dqadd71691 add -11 11 -> 0
  1016. dqadd71692 add 11 -11 -> 0
  1017. rounding: ceiling
  1018. -- exact zeros from zeros
  1019. dqadd71700 add 0 0E-19 -> 0E-19
  1020. dqadd71701 add -0 0E-19 -> 0E-19
  1021. dqadd71702 add 0 -0E-19 -> 0E-19
  1022. dqadd71703 add -0 -0E-19 -> -0E-19
  1023. -- exact zeros from non-zeros
  1024. dqadd71711 add -11 11 -> 0
  1025. dqadd71712 add 11 -11 -> 0
  1026. -- and the extra-special ugly case; unusual minuses marked by -- *
  1027. rounding: floor
  1028. -- exact zeros from zeros
  1029. dqadd71720 add 0 0E-19 -> 0E-19
  1030. dqadd71721 add -0 0E-19 -> -0E-19 -- *
  1031. dqadd71722 add 0 -0E-19 -> -0E-19 -- *
  1032. dqadd71723 add -0 -0E-19 -> -0E-19
  1033. -- exact zeros from non-zeros
  1034. dqadd71731 add -11 11 -> -0 -- *
  1035. dqadd71732 add 11 -11 -> -0 -- *
  1036. -- Examples from SQL proposal (Krishna Kulkarni)
  1037. dqadd71741 add 130E-2 120E-2 -> 2.50
  1038. dqadd71742 add 130E-2 12E-1 -> 2.50
  1039. dqadd71743 add 130E-2 1E0 -> 2.30
  1040. dqadd71744 add 1E2 1E4 -> 1.01E+4
  1041. dqadd71745 add 130E-2 -120E-2 -> 0.10
  1042. dqadd71746 add 130E-2 -12E-1 -> 0.10
  1043. dqadd71747 add 130E-2 -1E0 -> 0.30
  1044. dqadd71748 add 1E2 -1E4 -> -9.9E+3
  1045. -- Gappy coefficients; check residue handling even with full coefficient gap
  1046. rounding: half_even
  1047. dqadd75001 add 1239876543211234567894567890123456 1 -> 1239876543211234567894567890123457
  1048. dqadd75002 add 1239876543211234567894567890123456 0.6 -> 1239876543211234567894567890123457 Inexact Rounded
  1049. dqadd75003 add 1239876543211234567894567890123456 0.06 -> 1239876543211234567894567890123456 Inexact Rounded
  1050. dqadd75004 add 1239876543211234567894567890123456 6E-3 -> 1239876543211234567894567890123456 Inexact Rounded
  1051. dqadd75005 add 1239876543211234567894567890123456 6E-4 -> 1239876543211234567894567890123456 Inexact Rounded
  1052. dqadd75006 add 1239876543211234567894567890123456 6E-5 -> 1239876543211234567894567890123456 Inexact Rounded
  1053. dqadd75007 add 1239876543211234567894567890123456 6E-6 -> 1239876543211234567894567890123456 Inexact Rounded
  1054. dqadd75008 add 1239876543211234567894567890123456 6E-7 -> 1239876543211234567894567890123456 Inexact Rounded
  1055. dqadd75009 add 1239876543211234567894567890123456 6E-8 -> 1239876543211234567894567890123456 Inexact Rounded
  1056. dqadd75010 add 1239876543211234567894567890123456 6E-9 -> 1239876543211234567894567890123456 Inexact Rounded
  1057. dqadd75011 add 1239876543211234567894567890123456 6E-10 -> 1239876543211234567894567890123456 Inexact Rounded
  1058. dqadd75012 add 1239876543211234567894567890123456 6E-11 -> 1239876543211234567894567890123456 Inexact Rounded
  1059. dqadd75013 add 1239876543211234567894567890123456 6E-12 -> 1239876543211234567894567890123456 Inexact Rounded
  1060. dqadd75014 add 1239876543211234567894567890123456 6E-13 -> 1239876543211234567894567890123456 Inexact Rounded
  1061. dqadd75015 add 1239876543211234567894567890123456 6E-14 -> 1239876543211234567894567890123456 Inexact Rounded
  1062. dqadd75016 add 1239876543211234567894567890123456 6E-15 -> 1239876543211234567894567890123456 Inexact Rounded
  1063. dqadd75017 add 1239876543211234567894567890123456 6E-16 -> 1239876543211234567894567890123456 Inexact Rounded
  1064. dqadd75018 add 1239876543211234567894567890123456 6E-17 -> 1239876543211234567894567890123456 Inexact Rounded
  1065. dqadd75019 add 1239876543211234567894567890123456 6E-18 -> 1239876543211234567894567890123456 Inexact Rounded
  1066. dqadd75020 add 1239876543211234567894567890123456 6E-19 -> 1239876543211234567894567890123456 Inexact Rounded
  1067. dqadd75021 add 1239876543211234567894567890123456 6E-20 -> 1239876543211234567894567890123456 Inexact Rounded
  1068. -- widening second argument at gap
  1069. dqadd75030 add 12398765432112345678945678 1 -> 12398765432112345678945679
  1070. dqadd75031 add 12398765432112345678945678 0.1 -> 12398765432112345678945678.1
  1071. dqadd75032 add 12398765432112345678945678 0.12 -> 12398765432112345678945678.12
  1072. dqadd75033 add 12398765432112345678945678 0.123 -> 12398765432112345678945678.123
  1073. dqadd75034 add 12398765432112345678945678 0.1234 -> 12398765432112345678945678.1234
  1074. dqadd75035 add 12398765432112345678945678 0.12345 -> 12398765432112345678945678.12345
  1075. dqadd75036 add 12398765432112345678945678 0.123456 -> 12398765432112345678945678.123456
  1076. dqadd75037 add 12398765432112345678945678 0.1234567 -> 12398765432112345678945678.1234567
  1077. dqadd75038 add 12398765432112345678945678 0.12345678 -> 12398765432112345678945678.12345678
  1078. dqadd75039 add 12398765432112345678945678 0.123456789 -> 12398765432112345678945678.12345679 Inexact Rounded
  1079. dqadd75040 add 12398765432112345678945678 0.123456785 -> 12398765432112345678945678.12345678 Inexact Rounded
  1080. dqadd75041 add 12398765432112345678945678 0.1234567850 -> 12398765432112345678945678.12345678 Inexact Rounded
  1081. dqadd75042 add 12398765432112345678945678 0.1234567851 -> 12398765432112345678945678.12345679 Inexact Rounded
  1082. dqadd75043 add 12398765432112345678945678 0.12345678501 -> 12398765432112345678945678.12345679 Inexact Rounded
  1083. dqadd75044 add 12398765432112345678945678 0.123456785001 -> 12398765432112345678945678.12345679 Inexact Rounded
  1084. dqadd75045 add 12398765432112345678945678 0.1234567850001 -> 12398765432112345678945678.12345679 Inexact Rounded
  1085. dqadd75046 add 12398765432112345678945678 0.12345678500001 -> 12398765432112345678945678.12345679 Inexact Rounded
  1086. dqadd75047 add 12398765432112345678945678 0.123456785000001 -> 12398765432112345678945678.12345679 Inexact Rounded
  1087. dqadd75048 add 12398765432112345678945678 0.1234567850000001 -> 12398765432112345678945678.12345679 Inexact Rounded
  1088. dqadd75049 add 12398765432112345678945678 0.1234567850000000 -> 12398765432112345678945678.12345678 Inexact Rounded
  1089. -- 90123456
  1090. rounding: half_even
  1091. dqadd75050 add 12398765432112345678945678 0.0234567750000000 -> 12398765432112345678945678.02345678 Inexact Rounded
  1092. dqadd75051 add 12398765432112345678945678 0.0034567750000000 -> 12398765432112345678945678.00345678 Inexact Rounded
  1093. dqadd75052 add 12398765432112345678945678 0.0004567750000000 -> 12398765432112345678945678.00045678 Inexact Rounded
  1094. dqadd75053 add 12398765432112345678945678 0.0000567750000000 -> 12398765432112345678945678.00005678 Inexact Rounded
  1095. dqadd75054 add 12398765432112345678945678 0.0000067750000000 -> 12398765432112345678945678.00000678 Inexact Rounded
  1096. dqadd75055 add 12398765432112345678945678 0.0000007750000000 -> 12398765432112345678945678.00000078 Inexact Rounded
  1097. dqadd75056 add 12398765432112345678945678 0.0000000750000000 -> 12398765432112345678945678.00000008 Inexact Rounded
  1098. dqadd75057 add 12398765432112345678945678 0.0000000050000000 -> 12398765432112345678945678.00000000 Inexact Rounded
  1099. dqadd75060 add 12398765432112345678945678 0.0234567750000001 -> 12398765432112345678945678.02345678 Inexact Rounded
  1100. dqadd75061 add 12398765432112345678945678 0.0034567750000001 -> 12398765432112345678945678.00345678 Inexact Rounded
  1101. dqadd75062 add 12398765432112345678945678 0.0004567750000001 -> 12398765432112345678945678.00045678 Inexact Rounded
  1102. dqadd75063 add 12398765432112345678945678 0.0000567750000001 -> 12398765432112345678945678.00005678 Inexact Rounded
  1103. dqadd75064 add 12398765432112345678945678 0.0000067750000001 -> 12398765432112345678945678.00000678 Inexact Rounded
  1104. dqadd75065 add 12398765432112345678945678 0.0000007750000001 -> 12398765432112345678945678.00000078 Inexact Rounded
  1105. dqadd75066 add 12398765432112345678945678 0.0000000750000001 -> 12398765432112345678945678.00000008 Inexact Rounded
  1106. dqadd75067 add 12398765432112345678945678 0.0000000050000001 -> 12398765432112345678945678.00000001 Inexact Rounded
  1107. -- far-out residues (full coefficient gap is 16+15 digits)
  1108. rounding: up
  1109. dqadd75070 add 12398765432112345678945678 1E-8 -> 12398765432112345678945678.00000001
  1110. dqadd75071 add 12398765432112345678945678 1E-9 -> 12398765432112345678945678.00000001 Inexact Rounded
  1111. dqadd75072 add 12398765432112345678945678 1E-10 -> 12398765432112345678945678.00000001 Inexact Rounded
  1112. dqadd75073 add 12398765432112345678945678 1E-11 -> 12398765432112345678945678.00000001 Inexact Rounded
  1113. dqadd75074 add 12398765432112345678945678 1E-12 -> 12398765432112345678945678.00000001 Inexact Rounded
  1114. dqadd75075 add 12398765432112345678945678 1E-13 -> 12398765432112345678945678.00000001 Inexact Rounded
  1115. dqadd75076 add 12398765432112345678945678 1E-14 -> 12398765432112345678945678.00000001 Inexact Rounded
  1116. dqadd75077 add 12398765432112345678945678 1E-15 -> 12398765432112345678945678.00000001 Inexact Rounded
  1117. dqadd75078 add 12398765432112345678945678 1E-16 -> 12398765432112345678945678.00000001 Inexact Rounded
  1118. dqadd75079 add 12398765432112345678945678 1E-17 -> 12398765432112345678945678.00000001 Inexact Rounded
  1119. dqadd75080 add 12398765432112345678945678 1E-18 -> 12398765432112345678945678.00000001 Inexact Rounded
  1120. dqadd75081 add 12398765432112345678945678 1E-19 -> 12398765432112345678945678.00000001 Inexact Rounded
  1121. dqadd75082 add 12398765432112345678945678 1E-20 -> 12398765432112345678945678.00000001 Inexact Rounded
  1122. dqadd75083 add 12398765432112345678945678 1E-25 -> 12398765432112345678945678.00000001 Inexact Rounded
  1123. dqadd75084 add 12398765432112345678945678 1E-30 -> 12398765432112345678945678.00000001 Inexact Rounded
  1124. dqadd75085 add 12398765432112345678945678 1E-31 -> 12398765432112345678945678.00000001 Inexact Rounded
  1125. dqadd75086 add 12398765432112345678945678 1E-32 -> 12398765432112345678945678.00000001 Inexact Rounded
  1126. dqadd75087 add 12398765432112345678945678 1E-33 -> 12398765432112345678945678.00000001 Inexact Rounded
  1127. dqadd75088 add 12398765432112345678945678 1E-34 -> 12398765432112345678945678.00000001 Inexact Rounded
  1128. dqadd75089 add 12398765432112345678945678 1E-35 -> 12398765432112345678945678.00000001 Inexact Rounded
  1129. -- Null tests
  1130. dqadd9990 add 10 # -> NaN Invalid_operation
  1131. dqadd9991 add # 10 -> NaN Invalid_operation