divide.decTest 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854
  1. ------------------------------------------------------------------------
  2. -- divide.decTest -- decimal division --
  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. extended: 1
  22. precision: 9
  23. rounding: half_up
  24. maxExponent: 384
  25. minexponent: -383
  26. -- sanity checks
  27. divx001 divide 1 1 -> 1
  28. divx002 divide 2 1 -> 2
  29. divx003 divide 1 2 -> 0.5
  30. divx004 divide 2 2 -> 1
  31. divx005 divide 0 1 -> 0
  32. divx006 divide 0 2 -> 0
  33. divx007 divide 1 3 -> 0.333333333 Inexact Rounded
  34. divx008 divide 2 3 -> 0.666666667 Inexact Rounded
  35. divx009 divide 3 3 -> 1
  36. divx010 divide 2.4 1 -> 2.4
  37. divx011 divide 2.4 -1 -> -2.4
  38. divx012 divide -2.4 1 -> -2.4
  39. divx013 divide -2.4 -1 -> 2.4
  40. divx014 divide 2.40 1 -> 2.40
  41. divx015 divide 2.400 1 -> 2.400
  42. divx016 divide 2.4 2 -> 1.2
  43. divx017 divide 2.400 2 -> 1.200
  44. divx018 divide 2. 2 -> 1
  45. divx019 divide 20 20 -> 1
  46. divx020 divide 187 187 -> 1
  47. divx021 divide 5 2 -> 2.5
  48. divx022 divide 50 20 -> 2.5
  49. divx023 divide 500 200 -> 2.5
  50. divx024 divide 50.0 20.0 -> 2.5
  51. divx025 divide 5.00 2.00 -> 2.5
  52. divx026 divide 5 2.0 -> 2.5
  53. divx027 divide 5 2.000 -> 2.5
  54. divx028 divide 5 0.20 -> 25
  55. divx029 divide 5 0.200 -> 25
  56. divx030 divide 10 1 -> 10
  57. divx031 divide 100 1 -> 100
  58. divx032 divide 1000 1 -> 1000
  59. divx033 divide 1000 100 -> 10
  60. divx035 divide 1 2 -> 0.5
  61. divx036 divide 1 4 -> 0.25
  62. divx037 divide 1 8 -> 0.125
  63. divx038 divide 1 16 -> 0.0625
  64. divx039 divide 1 32 -> 0.03125
  65. divx040 divide 1 64 -> 0.015625
  66. divx041 divide 1 -2 -> -0.5
  67. divx042 divide 1 -4 -> -0.25
  68. divx043 divide 1 -8 -> -0.125
  69. divx044 divide 1 -16 -> -0.0625
  70. divx045 divide 1 -32 -> -0.03125
  71. divx046 divide 1 -64 -> -0.015625
  72. divx047 divide -1 2 -> -0.5
  73. divx048 divide -1 4 -> -0.25
  74. divx049 divide -1 8 -> -0.125
  75. divx050 divide -1 16 -> -0.0625
  76. divx051 divide -1 32 -> -0.03125
  77. divx052 divide -1 64 -> -0.015625
  78. divx053 divide -1 -2 -> 0.5
  79. divx054 divide -1 -4 -> 0.25
  80. divx055 divide -1 -8 -> 0.125
  81. divx056 divide -1 -16 -> 0.0625
  82. divx057 divide -1 -32 -> 0.03125
  83. divx058 divide -1 -64 -> 0.015625
  84. divx070 divide 999999999 1 -> 999999999
  85. divx071 divide 999999999.4 1 -> 999999999 Inexact Rounded
  86. divx072 divide 999999999.5 1 -> 1.00000000E+9 Inexact Rounded
  87. divx073 divide 999999999.9 1 -> 1.00000000E+9 Inexact Rounded
  88. divx074 divide 999999999.999 1 -> 1.00000000E+9 Inexact Rounded
  89. precision: 6
  90. divx080 divide 999999999 1 -> 1.00000E+9 Inexact Rounded
  91. divx081 divide 99999999 1 -> 1.00000E+8 Inexact Rounded
  92. divx082 divide 9999999 1 -> 1.00000E+7 Inexact Rounded
  93. divx083 divide 999999 1 -> 999999
  94. divx084 divide 99999 1 -> 99999
  95. divx085 divide 9999 1 -> 9999
  96. divx086 divide 999 1 -> 999
  97. divx087 divide 99 1 -> 99
  98. divx088 divide 9 1 -> 9
  99. precision: 9
  100. divx090 divide 0. 1 -> 0
  101. divx091 divide .0 1 -> 0.0
  102. divx092 divide 0.00 1 -> 0.00
  103. divx093 divide 0.00E+9 1 -> 0E+7
  104. divx094 divide 0.0000E-50 1 -> 0E-54
  105. divx095 divide 1 1E-8 -> 1E+8
  106. divx096 divide 1 1E-9 -> 1E+9
  107. divx097 divide 1 1E-10 -> 1E+10
  108. divx098 divide 1 1E-11 -> 1E+11
  109. divx099 divide 1 1E-12 -> 1E+12
  110. divx100 divide 1 1 -> 1
  111. divx101 divide 1 2 -> 0.5
  112. divx102 divide 1 3 -> 0.333333333 Inexact Rounded
  113. divx103 divide 1 4 -> 0.25
  114. divx104 divide 1 5 -> 0.2
  115. divx105 divide 1 6 -> 0.166666667 Inexact Rounded
  116. divx106 divide 1 7 -> 0.142857143 Inexact Rounded
  117. divx107 divide 1 8 -> 0.125
  118. divx108 divide 1 9 -> 0.111111111 Inexact Rounded
  119. divx109 divide 1 10 -> 0.1
  120. divx110 divide 1 1 -> 1
  121. divx111 divide 2 1 -> 2
  122. divx112 divide 3 1 -> 3
  123. divx113 divide 4 1 -> 4
  124. divx114 divide 5 1 -> 5
  125. divx115 divide 6 1 -> 6
  126. divx116 divide 7 1 -> 7
  127. divx117 divide 8 1 -> 8
  128. divx118 divide 9 1 -> 9
  129. divx119 divide 10 1 -> 10
  130. divx120 divide 3E+1 0.001 -> 3E+4
  131. divx121 divide 2.200 2 -> 1.100
  132. divx130 divide 12345 4.999 -> 2469.49390 Inexact Rounded
  133. divx131 divide 12345 4.99 -> 2473.94790 Inexact Rounded
  134. divx132 divide 12345 4.9 -> 2519.38776 Inexact Rounded
  135. divx133 divide 12345 5 -> 2469
  136. divx134 divide 12345 5.1 -> 2420.58824 Inexact Rounded
  137. divx135 divide 12345 5.01 -> 2464.07186 Inexact Rounded
  138. divx136 divide 12345 5.001 -> 2468.50630 Inexact Rounded
  139. precision: 9
  140. maxexponent: 999999999
  141. minexponent: -999999999
  142. -- test possibly imprecise results
  143. divx220 divide 391 597 -> 0.654941374 Inexact Rounded
  144. divx221 divide 391 -597 -> -0.654941374 Inexact Rounded
  145. divx222 divide -391 597 -> -0.654941374 Inexact Rounded
  146. divx223 divide -391 -597 -> 0.654941374 Inexact Rounded
  147. -- test some cases that are close to exponent overflow
  148. maxexponent: 999999999
  149. minexponent: -999999999
  150. divx270 divide 1 1e999999999 -> 1E-999999999
  151. divx271 divide 1 0.9e999999999 -> 1.11111111E-999999999 Inexact Rounded
  152. divx272 divide 1 0.99e999999999 -> 1.01010101E-999999999 Inexact Rounded
  153. divx273 divide 1 0.999999999e999999999 -> 1.00000000E-999999999 Inexact Rounded
  154. divx274 divide 9e999999999 1 -> 9E+999999999
  155. divx275 divide 9.9e999999999 1 -> 9.9E+999999999
  156. divx276 divide 9.99e999999999 1 -> 9.99E+999999999
  157. divx277 divide 9.99999999e999999999 1 -> 9.99999999E+999999999
  158. divx280 divide 0.1 9e-999999999 -> 1.11111111E+999999997 Inexact Rounded
  159. divx281 divide 0.1 99e-999999999 -> 1.01010101E+999999996 Inexact Rounded
  160. divx282 divide 0.1 999e-999999999 -> 1.00100100E+999999995 Inexact Rounded
  161. divx283 divide 0.1 9e-999999998 -> 1.11111111E+999999996 Inexact Rounded
  162. divx284 divide 0.1 99e-999999998 -> 1.01010101E+999999995 Inexact Rounded
  163. divx285 divide 0.1 999e-999999998 -> 1.00100100E+999999994 Inexact Rounded
  164. divx286 divide 0.1 999e-999999997 -> 1.00100100E+999999993 Inexact Rounded
  165. divx287 divide 0.1 9999e-999999997 -> 1.00010001E+999999992 Inexact Rounded
  166. divx288 divide 0.1 99999e-999999997 -> 1.00001000E+999999991 Inexact Rounded
  167. -- Divide into 0 tests
  168. divx301 divide 0 7 -> 0
  169. divx302 divide 0 7E-5 -> 0E+5
  170. divx303 divide 0 7E-1 -> 0E+1
  171. divx304 divide 0 7E+1 -> 0.0
  172. divx305 divide 0 7E+5 -> 0.00000
  173. divx306 divide 0 7E+6 -> 0.000000
  174. divx307 divide 0 7E+7 -> 0E-7
  175. divx308 divide 0 70E-5 -> 0E+5
  176. divx309 divide 0 70E-1 -> 0E+1
  177. divx310 divide 0 70E+0 -> 0
  178. divx311 divide 0 70E+1 -> 0.0
  179. divx312 divide 0 70E+5 -> 0.00000
  180. divx313 divide 0 70E+6 -> 0.000000
  181. divx314 divide 0 70E+7 -> 0E-7
  182. divx315 divide 0 700E-5 -> 0E+5
  183. divx316 divide 0 700E-1 -> 0E+1
  184. divx317 divide 0 700E+0 -> 0
  185. divx318 divide 0 700E+1 -> 0.0
  186. divx319 divide 0 700E+5 -> 0.00000
  187. divx320 divide 0 700E+6 -> 0.000000
  188. divx321 divide 0 700E+7 -> 0E-7
  189. divx322 divide 0 700E+77 -> 0E-77
  190. divx331 divide 0E-3 7E-5 -> 0E+2
  191. divx332 divide 0E-3 7E-1 -> 0.00
  192. divx333 divide 0E-3 7E+1 -> 0.0000
  193. divx334 divide 0E-3 7E+5 -> 0E-8
  194. divx335 divide 0E-1 7E-5 -> 0E+4
  195. divx336 divide 0E-1 7E-1 -> 0
  196. divx337 divide 0E-1 7E+1 -> 0.00
  197. divx338 divide 0E-1 7E+5 -> 0.000000
  198. divx339 divide 0E+1 7E-5 -> 0E+6
  199. divx340 divide 0E+1 7E-1 -> 0E+2
  200. divx341 divide 0E+1 7E+1 -> 0
  201. divx342 divide 0E+1 7E+5 -> 0.0000
  202. divx343 divide 0E+3 7E-5 -> 0E+8
  203. divx344 divide 0E+3 7E-1 -> 0E+4
  204. divx345 divide 0E+3 7E+1 -> 0E+2
  205. divx346 divide 0E+3 7E+5 -> 0.00
  206. maxexponent: 92
  207. minexponent: -92
  208. precision: 7
  209. divx351 divide 0E-92 7E-1 -> 0E-91
  210. divx352 divide 0E-92 7E+1 -> 0E-93
  211. divx353 divide 0E-92 7E+5 -> 0E-97
  212. divx354 divide 0E-92 7E+6 -> 0E-98
  213. divx355 divide 0E-92 7E+7 -> 0E-98 Clamped
  214. divx356 divide 0E-92 777E-1 -> 0E-91
  215. divx357 divide 0E-92 777E+1 -> 0E-93
  216. divx358 divide 0E-92 777E+3 -> 0E-95
  217. divx359 divide 0E-92 777E+4 -> 0E-96
  218. divx360 divide 0E-92 777E+5 -> 0E-97
  219. divx361 divide 0E-92 777E+6 -> 0E-98
  220. divx362 divide 0E-92 777E+7 -> 0E-98 Clamped
  221. divx363 divide 0E-92 7E+92 -> 0E-98 Clamped
  222. divx371 divide 0E-92 700E-1 -> 0E-91
  223. divx372 divide 0E-92 700E+1 -> 0E-93
  224. divx373 divide 0E-92 700E+3 -> 0E-95
  225. divx374 divide 0E-92 700E+4 -> 0E-96
  226. divx375 divide 0E-92 700E+5 -> 0E-97
  227. divx376 divide 0E-92 700E+6 -> 0E-98
  228. divx377 divide 0E-92 700E+7 -> 0E-98 Clamped
  229. divx381 divide 0E+92 7E+1 -> 0E+91
  230. divx382 divide 0E+92 7E+0 -> 0E+92
  231. divx383 divide 0E+92 7E-1 -> 0E+92 Clamped
  232. divx384 divide 0E+90 777E+1 -> 0E+89
  233. divx385 divide 0E+90 777E-1 -> 0E+91
  234. divx386 divide 0E+90 777E-2 -> 0E+92
  235. divx387 divide 0E+90 777E-3 -> 0E+92 Clamped
  236. divx388 divide 0E+90 777E-4 -> 0E+92 Clamped
  237. divx391 divide 0E+90 700E+1 -> 0E+89
  238. divx392 divide 0E+90 700E-1 -> 0E+91
  239. divx393 divide 0E+90 700E-2 -> 0E+92
  240. divx394 divide 0E+90 700E-3 -> 0E+92 Clamped
  241. divx395 divide 0E+90 700E-4 -> 0E+92 Clamped
  242. -- input rounding checks
  243. maxexponent: 999
  244. minexponent: -999
  245. precision: 9
  246. divx401 divide 12345678000 1 -> 1.23456780E+10 Rounded
  247. divx402 divide 1 12345678000 -> 8.10000066E-11 Inexact Rounded
  248. divx403 divide 1234567800 1 -> 1.23456780E+9 Rounded
  249. divx404 divide 1 1234567800 -> 8.10000066E-10 Inexact Rounded
  250. divx405 divide 1234567890 1 -> 1.23456789E+9 Rounded
  251. divx406 divide 1 1234567890 -> 8.10000007E-10 Inexact Rounded
  252. divx407 divide 1234567891 1 -> 1.23456789E+9 Inexact Rounded
  253. divx408 divide 1 1234567891 -> 8.10000007E-10 Inexact Rounded
  254. divx409 divide 12345678901 1 -> 1.23456789E+10 Inexact Rounded
  255. divx410 divide 1 12345678901 -> 8.10000007E-11 Inexact Rounded
  256. divx411 divide 1234567896 1 -> 1.23456790E+9 Inexact Rounded
  257. divx412 divide 1 1234567896 -> 8.10000003E-10 Inexact Rounded
  258. divx413 divide 1 1234567897 -> 8.10000003E-10 Inexact Rounded
  259. divx414 divide 1 1234567898 -> 8.10000002E-10 Inexact Rounded
  260. divx415 divide 1 1234567899 -> 8.10000001E-10 Inexact Rounded
  261. divx416 divide 1 1234567900 -> 8.10000001E-10 Inexact Rounded
  262. divx417 divide 1 1234567901 -> 8.10000000E-10 Inexact Rounded
  263. divx418 divide 1 1234567902 -> 8.09999999E-10 Inexact Rounded
  264. -- some longies
  265. divx421 divide 1234567896.000000000000 1 -> 1.23456790E+9 Inexact Rounded
  266. divx422 divide 1 1234567896.000000000000 -> 8.10000003E-10 Inexact Rounded
  267. divx423 divide 1234567896.000000000001 1 -> 1.23456790E+9 Inexact Rounded
  268. divx424 divide 1 1234567896.000000000001 -> 8.10000003E-10 Inexact Rounded
  269. divx425 divide 1234567896.000000000000000000000000000000000000000009 1 -> 1.23456790E+9 Inexact Rounded
  270. divx426 divide 1 1234567896.000000000000000000000000000000000000000009 -> 8.10000003E-10 Inexact Rounded
  271. divx427 divide 1234567897.900010000000000000000000000000000000000009 1 -> 1.23456790E+9 Inexact Rounded
  272. divx428 divide 1 1234567897.900010000000000000000000000000000000000009 -> 8.10000002E-10 Inexact Rounded
  273. precision: 15
  274. -- still checking...
  275. divx441 divide 12345678000 1 -> 12345678000
  276. divx442 divide 1 12345678000 -> 8.10000066420005E-11 Inexact Rounded
  277. divx443 divide 1234567800 1 -> 1234567800
  278. divx444 divide 1 1234567800 -> 8.10000066420005E-10 Inexact Rounded
  279. divx445 divide 1234567890 1 -> 1234567890
  280. divx446 divide 1 1234567890 -> 8.10000007371000E-10 Inexact Rounded
  281. divx447 divide 1234567891 1 -> 1234567891
  282. divx448 divide 1 1234567891 -> 8.10000006714900E-10 Inexact Rounded
  283. divx449 divide 12345678901 1 -> 12345678901
  284. divx450 divide 1 12345678901 -> 8.10000007305390E-11 Inexact Rounded
  285. divx451 divide 1234567896 1 -> 1234567896
  286. divx452 divide 1 1234567896 -> 8.10000003434400E-10 Inexact Rounded
  287. -- high-lows
  288. divx453 divide 1e+1 1 -> 1E+1
  289. divx454 divide 1e+1 1.0 -> 1E+1
  290. divx455 divide 1e+1 1.00 -> 1E+1
  291. divx456 divide 1e+2 2 -> 5E+1
  292. divx457 divide 1e+2 2.0 -> 5E+1
  293. divx458 divide 1e+2 2.00 -> 5E+1
  294. -- some from IEEE discussions
  295. divx460 divide 3e0 2e0 -> 1.5
  296. divx461 divide 30e-1 2e0 -> 1.5
  297. divx462 divide 300e-2 2e0 -> 1.50
  298. divx464 divide 3000e-3 2e0 -> 1.500
  299. divx465 divide 3e0 20e-1 -> 1.5
  300. divx466 divide 30e-1 20e-1 -> 1.5
  301. divx467 divide 300e-2 20e-1 -> 1.5
  302. divx468 divide 3000e-3 20e-1 -> 1.50
  303. divx469 divide 3e0 200e-2 -> 1.5
  304. divx470 divide 30e-1 200e-2 -> 1.5
  305. divx471 divide 300e-2 200e-2 -> 1.5
  306. divx472 divide 3000e-3 200e-2 -> 1.5
  307. divx473 divide 3e0 2000e-3 -> 1.5
  308. divx474 divide 30e-1 2000e-3 -> 1.5
  309. divx475 divide 300e-2 2000e-3 -> 1.5
  310. divx476 divide 3000e-3 2000e-3 -> 1.5
  311. -- some reciprocals
  312. divx480 divide 1 1.0E+33 -> 1E-33
  313. divx481 divide 1 10E+33 -> 1E-34
  314. divx482 divide 1 1.0E-33 -> 1E+33
  315. divx483 divide 1 10E-33 -> 1E+32
  316. -- RMS discussion table
  317. maxexponent: 96
  318. minexponent: -95
  319. precision: 7
  320. divx484 divide 0e5 1e3 -> 0E+2
  321. divx485 divide 0e5 2e3 -> 0E+2
  322. divx486 divide 0e5 10e2 -> 0E+3
  323. divx487 divide 0e5 20e2 -> 0E+3
  324. divx488 divide 0e5 100e1 -> 0E+4
  325. divx489 divide 0e5 200e1 -> 0E+4
  326. divx491 divide 1e5 1e3 -> 1E+2
  327. divx492 divide 1e5 2e3 -> 5E+1
  328. divx493 divide 1e5 10e2 -> 1E+2
  329. divx494 divide 1e5 20e2 -> 5E+1
  330. divx495 divide 1e5 100e1 -> 1E+2
  331. divx496 divide 1e5 200e1 -> 5E+1
  332. -- tryzeros cases
  333. precision: 7
  334. rounding: half_up
  335. maxExponent: 92
  336. minexponent: -92
  337. divx497 divide 0E+86 1000E-13 -> 0E+92 Clamped
  338. divx498 divide 0E-98 1000E+13 -> 0E-98 Clamped
  339. precision: 9
  340. rounding: half_up
  341. maxExponent: 999
  342. minexponent: -999
  343. -- focus on trailing zeros issues
  344. precision: 9
  345. divx500 divide 1 9.9 -> 0.101010101 Inexact Rounded
  346. precision: 8
  347. divx501 divide 1 9.9 -> 0.10101010 Inexact Rounded
  348. precision: 7
  349. divx502 divide 1 9.9 -> 0.1010101 Inexact Rounded
  350. precision: 6
  351. divx503 divide 1 9.9 -> 0.101010 Inexact Rounded
  352. precision: 9
  353. divx511 divide 1 2 -> 0.5
  354. divx512 divide 1.0 2 -> 0.5
  355. divx513 divide 1.00 2 -> 0.50
  356. divx514 divide 1.000 2 -> 0.500
  357. divx515 divide 1.0000 2 -> 0.5000
  358. divx516 divide 1.00000 2 -> 0.50000
  359. divx517 divide 1.000000 2 -> 0.500000
  360. divx518 divide 1.0000000 2 -> 0.5000000
  361. divx519 divide 1.00 2.00 -> 0.5
  362. divx521 divide 2 1 -> 2
  363. divx522 divide 2 1.0 -> 2
  364. divx523 divide 2 1.00 -> 2
  365. divx524 divide 2 1.000 -> 2
  366. divx525 divide 2 1.0000 -> 2
  367. divx526 divide 2 1.00000 -> 2
  368. divx527 divide 2 1.000000 -> 2
  369. divx528 divide 2 1.0000000 -> 2
  370. divx529 divide 2.00 1.00 -> 2
  371. divx530 divide 2.40 2 -> 1.20
  372. divx531 divide 2.40 4 -> 0.60
  373. divx532 divide 2.40 10 -> 0.24
  374. divx533 divide 2.40 2.0 -> 1.2
  375. divx534 divide 2.40 4.0 -> 0.6
  376. divx535 divide 2.40 10.0 -> 0.24
  377. divx536 divide 2.40 2.00 -> 1.2
  378. divx537 divide 2.40 4.00 -> 0.6
  379. divx538 divide 2.40 10.00 -> 0.24
  380. divx539 divide 0.9 0.1 -> 9
  381. divx540 divide 0.9 0.01 -> 9E+1
  382. divx541 divide 0.9 0.001 -> 9E+2
  383. divx542 divide 5 2 -> 2.5
  384. divx543 divide 5 2.0 -> 2.5
  385. divx544 divide 5 2.00 -> 2.5
  386. divx545 divide 5 20 -> 0.25
  387. divx546 divide 5 20.0 -> 0.25
  388. divx547 divide 2.400 2 -> 1.200
  389. divx548 divide 2.400 2.0 -> 1.20
  390. divx549 divide 2.400 2.400 -> 1
  391. divx550 divide 240 1 -> 240
  392. divx551 divide 240 10 -> 24
  393. divx552 divide 240 100 -> 2.4
  394. divx553 divide 240 1000 -> 0.24
  395. divx554 divide 2400 1 -> 2400
  396. divx555 divide 2400 10 -> 240
  397. divx556 divide 2400 100 -> 24
  398. divx557 divide 2400 1000 -> 2.4
  399. -- +ve exponent
  400. precision: 5
  401. divx570 divide 2.4E+6 2 -> 1.2E+6
  402. divx571 divide 2.40E+6 2 -> 1.20E+6
  403. divx572 divide 2.400E+6 2 -> 1.200E+6
  404. divx573 divide 2.4000E+6 2 -> 1.2000E+6
  405. divx574 divide 24E+5 2 -> 1.2E+6
  406. divx575 divide 240E+4 2 -> 1.20E+6
  407. divx576 divide 2400E+3 2 -> 1.200E+6
  408. divx577 divide 24000E+2 2 -> 1.2000E+6
  409. precision: 6
  410. divx580 divide 2.4E+6 2 -> 1.2E+6
  411. divx581 divide 2.40E+6 2 -> 1.20E+6
  412. divx582 divide 2.400E+6 2 -> 1.200E+6
  413. divx583 divide 2.4000E+6 2 -> 1.2000E+6
  414. divx584 divide 24E+5 2 -> 1.2E+6
  415. divx585 divide 240E+4 2 -> 1.20E+6
  416. divx586 divide 2400E+3 2 -> 1.200E+6
  417. divx587 divide 24000E+2 2 -> 1.2000E+6
  418. precision: 7
  419. divx590 divide 2.4E+6 2 -> 1.2E+6
  420. divx591 divide 2.40E+6 2 -> 1.20E+6
  421. divx592 divide 2.400E+6 2 -> 1.200E+6
  422. divx593 divide 2.4000E+6 2 -> 1.2000E+6
  423. divx594 divide 24E+5 2 -> 1.2E+6
  424. divx595 divide 240E+4 2 -> 1.20E+6
  425. divx596 divide 2400E+3 2 -> 1.200E+6
  426. divx597 divide 24000E+2 2 -> 1.2000E+6
  427. precision: 9
  428. divx600 divide 2.4E+9 2 -> 1.2E+9
  429. divx601 divide 2.40E+9 2 -> 1.20E+9
  430. divx602 divide 2.400E+9 2 -> 1.200E+9
  431. divx603 divide 2.4000E+9 2 -> 1.2000E+9
  432. divx604 divide 24E+8 2 -> 1.2E+9
  433. divx605 divide 240E+7 2 -> 1.20E+9
  434. divx606 divide 2400E+6 2 -> 1.200E+9
  435. divx607 divide 24000E+5 2 -> 1.2000E+9
  436. -- long operand triangle
  437. precision: 33
  438. divx610 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.8131097703792 Inexact Rounded
  439. precision: 32
  440. divx611 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.813109770379 Inexact Rounded
  441. precision: 31
  442. divx612 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.81310977038 Inexact Rounded
  443. precision: 30
  444. divx613 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.8131097704 Inexact Rounded
  445. precision: 29
  446. divx614 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.813109770 Inexact Rounded
  447. precision: 28
  448. divx615 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.81310977 Inexact Rounded
  449. precision: 27
  450. divx616 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.8131098 Inexact Rounded
  451. precision: 26
  452. divx617 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.813110 Inexact Rounded
  453. precision: 25
  454. divx618 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.81311 Inexact Rounded
  455. precision: 24
  456. divx619 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.8131 Inexact Rounded
  457. precision: 23
  458. divx620 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.813 Inexact Rounded
  459. precision: 22
  460. divx621 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.81 Inexact Rounded
  461. precision: 21
  462. divx622 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.8 Inexact Rounded
  463. precision: 20
  464. divx623 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817798 Inexact Rounded
  465. precision: 19
  466. divx624 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.101140888379681780E+19 Inexact Rounded
  467. precision: 18
  468. divx625 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.10114088837968178E+19 Inexact Rounded
  469. precision: 17
  470. divx626 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.1011408883796818E+19 Inexact Rounded
  471. precision: 16
  472. divx627 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.101140888379682E+19 Inexact Rounded
  473. precision: 15
  474. divx628 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.10114088837968E+19 Inexact Rounded
  475. precision: 14
  476. divx629 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.1011408883797E+19 Inexact Rounded
  477. precision: 13
  478. divx630 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.101140888380E+19 Inexact Rounded
  479. precision: 12
  480. divx631 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.10114088838E+19 Inexact Rounded
  481. precision: 11
  482. divx632 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.1011408884E+19 Inexact Rounded
  483. precision: 10
  484. divx633 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.101140888E+19 Inexact Rounded
  485. precision: 9
  486. divx634 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.10114089E+19 Inexact Rounded
  487. precision: 8
  488. divx635 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.1011409E+19 Inexact Rounded
  489. precision: 7
  490. divx636 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.101141E+19 Inexact Rounded
  491. precision: 6
  492. divx637 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.10114E+19 Inexact Rounded
  493. precision: 5
  494. divx638 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.1011E+19 Inexact Rounded
  495. precision: 4
  496. divx639 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.101E+19 Inexact Rounded
  497. precision: 3
  498. divx640 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.10E+19 Inexact Rounded
  499. precision: 2
  500. divx641 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.1E+19 Inexact Rounded
  501. precision: 1
  502. divx642 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4E+19 Inexact Rounded
  503. -- more zeros, etc.
  504. precision: 16
  505. rounding: half_up
  506. maxExponent: 384
  507. minExponent: -383
  508. divx731 divide 5.00 1E-3 -> 5.00E+3
  509. divx732 divide 00.00 0.000 -> NaN Division_undefined
  510. divx733 divide 00.00 0E-3 -> NaN Division_undefined
  511. divx734 divide 0 -0 -> NaN Division_undefined
  512. divx735 divide -0 0 -> NaN Division_undefined
  513. divx736 divide -0 -0 -> NaN Division_undefined
  514. divx741 divide 0 -1 -> -0
  515. divx742 divide -0 -1 -> 0
  516. divx743 divide 0 1 -> 0
  517. divx744 divide -0 1 -> -0
  518. divx745 divide -1 0 -> -Infinity Division_by_zero
  519. divx746 divide -1 -0 -> Infinity Division_by_zero
  520. divx747 divide 1 0 -> Infinity Division_by_zero
  521. divx748 divide 1 -0 -> -Infinity Division_by_zero
  522. divx751 divide 0.0 -1 -> -0.0
  523. divx752 divide -0.0 -1 -> 0.0
  524. divx753 divide 0.0 1 -> 0.0
  525. divx754 divide -0.0 1 -> -0.0
  526. divx755 divide -1.0 0 -> -Infinity Division_by_zero
  527. divx756 divide -1.0 -0 -> Infinity Division_by_zero
  528. divx757 divide 1.0 0 -> Infinity Division_by_zero
  529. divx758 divide 1.0 -0 -> -Infinity Division_by_zero
  530. divx761 divide 0 -1.0 -> -0E+1
  531. divx762 divide -0 -1.0 -> 0E+1
  532. divx763 divide 0 1.0 -> 0E+1
  533. divx764 divide -0 1.0 -> -0E+1
  534. divx765 divide -1 0.0 -> -Infinity Division_by_zero
  535. divx766 divide -1 -0.0 -> Infinity Division_by_zero
  536. divx767 divide 1 0.0 -> Infinity Division_by_zero
  537. divx768 divide 1 -0.0 -> -Infinity Division_by_zero
  538. divx771 divide 0.0 -1.0 -> -0
  539. divx772 divide -0.0 -1.0 -> 0
  540. divx773 divide 0.0 1.0 -> 0
  541. divx774 divide -0.0 1.0 -> -0
  542. divx775 divide -1.0 0.0 -> -Infinity Division_by_zero
  543. divx776 divide -1.0 -0.0 -> Infinity Division_by_zero
  544. divx777 divide 1.0 0.0 -> Infinity Division_by_zero
  545. divx778 divide 1.0 -0.0 -> -Infinity Division_by_zero
  546. -- Specials
  547. divx780 divide Inf -Inf -> NaN Invalid_operation
  548. divx781 divide Inf -1000 -> -Infinity
  549. divx782 divide Inf -1 -> -Infinity
  550. divx783 divide Inf -0 -> -Infinity
  551. divx784 divide Inf 0 -> Infinity
  552. divx785 divide Inf 1 -> Infinity
  553. divx786 divide Inf 1000 -> Infinity
  554. divx787 divide Inf Inf -> NaN Invalid_operation
  555. divx788 divide -1000 Inf -> -0E-398 Clamped
  556. divx789 divide -Inf Inf -> NaN Invalid_operation
  557. divx790 divide -1 Inf -> -0E-398 Clamped
  558. divx791 divide -0 Inf -> -0E-398 Clamped
  559. divx792 divide 0 Inf -> 0E-398 Clamped
  560. divx793 divide 1 Inf -> 0E-398 Clamped
  561. divx794 divide 1000 Inf -> 0E-398 Clamped
  562. divx795 divide Inf Inf -> NaN Invalid_operation
  563. divx800 divide -Inf -Inf -> NaN Invalid_operation
  564. divx801 divide -Inf -1000 -> Infinity
  565. divx802 divide -Inf -1 -> Infinity
  566. divx803 divide -Inf -0 -> Infinity
  567. divx804 divide -Inf 0 -> -Infinity
  568. divx805 divide -Inf 1 -> -Infinity
  569. divx806 divide -Inf 1000 -> -Infinity
  570. divx807 divide -Inf Inf -> NaN Invalid_operation
  571. divx808 divide -1000 Inf -> -0E-398 Clamped
  572. divx809 divide -Inf -Inf -> NaN Invalid_operation
  573. divx810 divide -1 -Inf -> 0E-398 Clamped
  574. divx811 divide -0 -Inf -> 0E-398 Clamped
  575. divx812 divide 0 -Inf -> -0E-398 Clamped
  576. divx813 divide 1 -Inf -> -0E-398 Clamped
  577. divx814 divide 1000 -Inf -> -0E-398 Clamped
  578. divx815 divide Inf -Inf -> NaN Invalid_operation
  579. divx821 divide NaN -Inf -> NaN
  580. divx822 divide NaN -1000 -> NaN
  581. divx823 divide NaN -1 -> NaN
  582. divx824 divide NaN -0 -> NaN
  583. divx825 divide NaN 0 -> NaN
  584. divx826 divide NaN 1 -> NaN
  585. divx827 divide NaN 1000 -> NaN
  586. divx828 divide NaN Inf -> NaN
  587. divx829 divide NaN NaN -> NaN
  588. divx830 divide -Inf NaN -> NaN
  589. divx831 divide -1000 NaN -> NaN
  590. divx832 divide -1 NaN -> NaN
  591. divx833 divide -0 NaN -> NaN
  592. divx834 divide 0 NaN -> NaN
  593. divx835 divide 1 NaN -> NaN
  594. divx836 divide 1000 NaN -> NaN
  595. divx837 divide Inf NaN -> NaN
  596. divx841 divide sNaN -Inf -> NaN Invalid_operation
  597. divx842 divide sNaN -1000 -> NaN Invalid_operation
  598. divx843 divide sNaN -1 -> NaN Invalid_operation
  599. divx844 divide sNaN -0 -> NaN Invalid_operation
  600. divx845 divide sNaN 0 -> NaN Invalid_operation
  601. divx846 divide sNaN 1 -> NaN Invalid_operation
  602. divx847 divide sNaN 1000 -> NaN Invalid_operation
  603. divx848 divide sNaN NaN -> NaN Invalid_operation
  604. divx849 divide sNaN sNaN -> NaN Invalid_operation
  605. divx850 divide NaN sNaN -> NaN Invalid_operation
  606. divx851 divide -Inf sNaN -> NaN Invalid_operation
  607. divx852 divide -1000 sNaN -> NaN Invalid_operation
  608. divx853 divide -1 sNaN -> NaN Invalid_operation
  609. divx854 divide -0 sNaN -> NaN Invalid_operation
  610. divx855 divide 0 sNaN -> NaN Invalid_operation
  611. divx856 divide 1 sNaN -> NaN Invalid_operation
  612. divx857 divide 1000 sNaN -> NaN Invalid_operation
  613. divx858 divide Inf sNaN -> NaN Invalid_operation
  614. divx859 divide NaN sNaN -> NaN Invalid_operation
  615. -- propagating NaNs
  616. divx861 divide NaN9 -Inf -> NaN9
  617. divx862 divide NaN8 1000 -> NaN8
  618. divx863 divide NaN7 Inf -> NaN7
  619. divx864 divide NaN6 NaN5 -> NaN6
  620. divx865 divide -Inf NaN4 -> NaN4
  621. divx866 divide -1000 NaN3 -> NaN3
  622. divx867 divide Inf NaN2 -> NaN2
  623. divx871 divide sNaN99 -Inf -> NaN99 Invalid_operation
  624. divx872 divide sNaN98 -1 -> NaN98 Invalid_operation
  625. divx873 divide sNaN97 NaN -> NaN97 Invalid_operation
  626. divx874 divide sNaN96 sNaN94 -> NaN96 Invalid_operation
  627. divx875 divide NaN95 sNaN93 -> NaN93 Invalid_operation
  628. divx876 divide -Inf sNaN92 -> NaN92 Invalid_operation
  629. divx877 divide 0 sNaN91 -> NaN91 Invalid_operation
  630. divx878 divide Inf sNaN90 -> NaN90 Invalid_operation
  631. divx879 divide NaN sNaN89 -> NaN89 Invalid_operation
  632. divx881 divide -NaN9 -Inf -> -NaN9
  633. divx882 divide -NaN8 1000 -> -NaN8
  634. divx883 divide -NaN7 Inf -> -NaN7
  635. divx884 divide -NaN6 -NaN5 -> -NaN6
  636. divx885 divide -Inf -NaN4 -> -NaN4
  637. divx886 divide -1000 -NaN3 -> -NaN3
  638. divx887 divide Inf -NaN2 -> -NaN2
  639. divx891 divide -sNaN99 -Inf -> -NaN99 Invalid_operation
  640. divx892 divide -sNaN98 -1 -> -NaN98 Invalid_operation
  641. divx893 divide -sNaN97 NaN -> -NaN97 Invalid_operation
  642. divx894 divide -sNaN96 -sNaN94 -> -NaN96 Invalid_operation
  643. divx895 divide -NaN95 -sNaN93 -> -NaN93 Invalid_operation
  644. divx896 divide -Inf -sNaN92 -> -NaN92 Invalid_operation
  645. divx897 divide 0 -sNaN91 -> -NaN91 Invalid_operation
  646. divx898 divide Inf -sNaN90 -> -NaN90 Invalid_operation
  647. divx899 divide -NaN -sNaN89 -> -NaN89 Invalid_operation
  648. maxexponent: 999999999
  649. minexponent: -999999999
  650. -- Various flavours of divide by 0
  651. divx901 divide 0 0 -> NaN Division_undefined
  652. divx902 divide 0.0E5 0 -> NaN Division_undefined
  653. divx903 divide 0.000 0 -> NaN Division_undefined
  654. divx904 divide 0.0001 0 -> Infinity Division_by_zero
  655. divx905 divide 0.01 0 -> Infinity Division_by_zero
  656. divx906 divide 0.1 0 -> Infinity Division_by_zero
  657. divx907 divide 1 0 -> Infinity Division_by_zero
  658. divx908 divide 1 0.0 -> Infinity Division_by_zero
  659. divx909 divide 10 0.0 -> Infinity Division_by_zero
  660. divx910 divide 1E+100 0.0 -> Infinity Division_by_zero
  661. divx911 divide 1E+1000 0 -> Infinity Division_by_zero
  662. divx921 divide -0.0001 0 -> -Infinity Division_by_zero
  663. divx922 divide -0.01 0 -> -Infinity Division_by_zero
  664. divx923 divide -0.1 0 -> -Infinity Division_by_zero
  665. divx924 divide -1 0 -> -Infinity Division_by_zero
  666. divx925 divide -1 0.0 -> -Infinity Division_by_zero
  667. divx926 divide -10 0.0 -> -Infinity Division_by_zero
  668. divx927 divide -1E+100 0.0 -> -Infinity Division_by_zero
  669. divx928 divide -1E+1000 0 -> -Infinity Division_by_zero
  670. divx931 divide 0.0001 -0 -> -Infinity Division_by_zero
  671. divx932 divide 0.01 -0 -> -Infinity Division_by_zero
  672. divx933 divide 0.1 -0 -> -Infinity Division_by_zero
  673. divx934 divide 1 -0 -> -Infinity Division_by_zero
  674. divx935 divide 1 -0.0 -> -Infinity Division_by_zero
  675. divx936 divide 10 -0.0 -> -Infinity Division_by_zero
  676. divx937 divide 1E+100 -0.0 -> -Infinity Division_by_zero
  677. divx938 divide 1E+1000 -0 -> -Infinity Division_by_zero
  678. divx941 divide -0.0001 -0 -> Infinity Division_by_zero
  679. divx942 divide -0.01 -0 -> Infinity Division_by_zero
  680. divx943 divide -0.1 -0 -> Infinity Division_by_zero
  681. divx944 divide -1 -0 -> Infinity Division_by_zero
  682. divx945 divide -1 -0.0 -> Infinity Division_by_zero
  683. divx946 divide -10 -0.0 -> Infinity Division_by_zero
  684. divx947 divide -1E+100 -0.0 -> Infinity Division_by_zero
  685. divx948 divide -1E+1000 -0 -> Infinity Division_by_zero
  686. -- overflow and underflow tests
  687. precision: 9
  688. maxexponent: 999999999
  689. minexponent: -999999999
  690. divx951 divide 9E+999999999 +0.23456789012345E-0 -> Infinity Inexact Overflow Rounded
  691. divx952 divide +0.100 9E+999999999 -> 1.111111E-1000000001 Inexact Rounded Underflow Subnormal
  692. divx953 divide 9E-999999999 +9.100 -> 9.8901099E-1000000000 Inexact Rounded Underflow Subnormal
  693. divx954 divide -1.23456789 9E+999999999 -> -1.3717421E-1000000000 Subnormal
  694. divx955 divide -1.23456789012345E-0 9E+999999999 -> -1.3717421E-1000000000 Underflow Subnormal Rounded Inexact
  695. divx956 divide -1.23456789012345E-0 7E+999999999 -> -1.7636684E-1000000000 Inexact Rounded Underflow Subnormal
  696. divx957 divide 9E+999999999 -0.83456789012345E-0 -> -Infinity Inexact Overflow Rounded
  697. divx958 divide -0.100 9E+999999999 -> -1.111111E-1000000001 Subnormal Inexact Rounded Underflow
  698. divx959 divide 9E-999999999 -9.100 -> -9.8901099E-1000000000 Inexact Rounded Underflow Subnormal
  699. -- overflow and underflow (additional edge tests in multiply.decTest)
  700. -- 'subnormal' results now possible (all hard underflow or overflow in
  701. -- base arithemtic)
  702. divx960 divide 1e-600000000 1e+400000001 -> 1E-1000000001 Subnormal
  703. divx961 divide 1e-600000000 1e+400000002 -> 1E-1000000002 Subnormal
  704. divx962 divide 1e-600000000 1e+400000003 -> 1E-1000000003 Subnormal
  705. divx963 divide 1e-600000000 1e+400000004 -> 1E-1000000004 Subnormal
  706. divx964 divide 1e-600000000 1e+400000005 -> 1E-1000000005 Subnormal
  707. divx965 divide 1e-600000000 1e+400000006 -> 1E-1000000006 Subnormal
  708. divx966 divide 1e-600000000 1e+400000007 -> 1E-1000000007 Subnormal
  709. divx967 divide 1e-600000000 1e+400000008 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
  710. divx968 divide 1e-600000000 1e+400000009 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
  711. divx969 divide 1e-600000000 1e+400000010 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
  712. -- [no equivalent of 'subnormal' for overflow]
  713. divx970 divide 1e+600000000 1e-400000001 -> Infinity Overflow Inexact Rounded
  714. divx971 divide 1e+600000000 1e-400000002 -> Infinity Overflow Inexact Rounded
  715. divx972 divide 1e+600000000 1e-400000003 -> Infinity Overflow Inexact Rounded
  716. divx973 divide 1e+600000000 1e-400000004 -> Infinity Overflow Inexact Rounded
  717. divx974 divide 1e+600000000 1e-400000005 -> Infinity Overflow Inexact Rounded
  718. divx975 divide 1e+600000000 1e-400000006 -> Infinity Overflow Inexact Rounded
  719. divx976 divide 1e+600000000 1e-400000007 -> Infinity Overflow Inexact Rounded
  720. divx977 divide 1e+600000000 1e-400000008 -> Infinity Overflow Inexact Rounded
  721. divx978 divide 1e+600000000 1e-400000009 -> Infinity Overflow Inexact Rounded
  722. divx979 divide 1e+600000000 1e-400000010 -> Infinity Overflow Inexact Rounded
  723. -- Sign after overflow and underflow
  724. divx980 divide 1e-600000000 1e+400000009 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
  725. divx981 divide 1e-600000000 -1e+400000009 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
  726. divx982 divide -1e-600000000 1e+400000009 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
  727. divx983 divide -1e-600000000 -1e+400000009 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
  728. divx984 divide 1e+600000000 1e-400000009 -> Infinity Overflow Inexact Rounded
  729. divx985 divide 1e+600000000 -1e-400000009 -> -Infinity Overflow Inexact Rounded
  730. divx986 divide -1e+600000000 1e-400000009 -> -Infinity Overflow Inexact Rounded
  731. divx987 divide -1e+600000000 -1e-400000009 -> Infinity Overflow Inexact Rounded
  732. -- Long operand overflow may be a different path
  733. precision: 3
  734. divx990 divide 1000 9.999E-999999999 -> Infinity Inexact Overflow Rounded
  735. divx991 divide 1000 -9.999E-999999999 -> -Infinity Inexact Overflow Rounded
  736. divx992 divide 9.999E+999999999 0.01 -> Infinity Inexact Overflow Rounded
  737. divx993 divide -9.999E+999999999 0.01 -> -Infinity Inexact Overflow Rounded
  738. -- check for double-rounded subnormals
  739. precision: 5
  740. maxexponent: 79
  741. minexponent: -79
  742. divx1001 divide 1.52444E-80 1 -> 1.524E-80 Inexact Rounded Subnormal Underflow
  743. divx1002 divide 1.52445E-80 1 -> 1.524E-80 Inexact Rounded Subnormal Underflow
  744. divx1003 divide 1.52446E-80 1 -> 1.524E-80 Inexact Rounded Subnormal Underflow
  745. -- a rounding problem in one implementation
  746. precision: 34
  747. rounding: half_up
  748. maxExponent: 6144
  749. minExponent: -6143
  750. -- Unbounded answer to 40 digits:
  751. -- 1.465811965811965811965811965811965811966E+7000
  752. divx1010 divide 343E6000 234E-1000 -> Infinity Overflow Inexact Rounded
  753. precision: 34
  754. rounding: half_up
  755. maxExponent: 6144
  756. minExponent: -6143
  757. -- Examples from SQL proposal (Krishna Kulkarni)
  758. precision: 7
  759. divx1021 divide 1E0 1E0 -> 1
  760. divx1022 divide 1E0 2E0 -> 0.5
  761. divx1023 divide 1E0 3E0 -> 0.3333333 Inexact Rounded
  762. divx1024 divide 100E-2 1000E-3 -> 1
  763. divx1025 divide 24E-1 2E0 -> 1.2
  764. divx1026 divide 2400E-3 2E0 -> 1.200
  765. divx1027 divide 5E0 2E0 -> 2.5
  766. divx1028 divide 5E0 20E-1 -> 2.5
  767. divx1029 divide 5E0 2000E-3 -> 2.5
  768. divx1030 divide 5E0 2E-1 -> 25
  769. divx1031 divide 5E0 20E-2 -> 25
  770. divx1032 divide 480E-2 3E0 -> 1.60
  771. divx1033 divide 47E-1 2E0 -> 2.35
  772. -- ECMAScript bad examples
  773. rounding: half_down
  774. precision: 7
  775. divx1050 divide 5 9 -> 0.5555556 Inexact Rounded
  776. rounding: half_even
  777. divx1051 divide 5 11 -> 0.4545455 Inexact Rounded
  778. -- payload decapitate
  779. precision: 5
  780. divx1055 divide sNaN987654321 1 -> NaN54321 Invalid_operation
  781. -- Null tests
  782. divx9998 divide 10 # -> NaN Invalid_operation
  783. divx9999 divide # 10 -> NaN Invalid_operation