dqQuantize.decTest 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836
  1. ------------------------------------------------------------------------
  2. -- dqQuantize.decTest -- decQuad quantize operation --
  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. -- Most of the tests here assume a "regular pattern", where the
  22. -- sign and coefficient are +1.
  23. -- 2004.03.15 Underflow for quantize is suppressed
  24. -- 2005.06.08 More extensive tests for 'does not fit'
  25. -- [Forked from quantize.decTest 2006.11.25]
  26. extended: 1
  27. clamp: 1
  28. precision: 34
  29. maxExponent: 6144
  30. minExponent: -6143
  31. rounding: half_even
  32. -- sanity checks
  33. dqqua001 quantize 0 1e0 -> 0
  34. dqqua002 quantize 1 1e0 -> 1
  35. dqqua003 quantize 0.1 1e+2 -> 0E+2 Inexact Rounded
  36. dqqua005 quantize 0.1 1e+1 -> 0E+1 Inexact Rounded
  37. dqqua006 quantize 0.1 1e0 -> 0 Inexact Rounded
  38. dqqua007 quantize 0.1 1e-1 -> 0.1
  39. dqqua008 quantize 0.1 1e-2 -> 0.10
  40. dqqua009 quantize 0.1 1e-3 -> 0.100
  41. dqqua010 quantize 0.9 1e+2 -> 0E+2 Inexact Rounded
  42. dqqua011 quantize 0.9 1e+1 -> 0E+1 Inexact Rounded
  43. dqqua012 quantize 0.9 1e+0 -> 1 Inexact Rounded
  44. dqqua013 quantize 0.9 1e-1 -> 0.9
  45. dqqua014 quantize 0.9 1e-2 -> 0.90
  46. dqqua015 quantize 0.9 1e-3 -> 0.900
  47. -- negatives
  48. dqqua021 quantize -0 1e0 -> -0
  49. dqqua022 quantize -1 1e0 -> -1
  50. dqqua023 quantize -0.1 1e+2 -> -0E+2 Inexact Rounded
  51. dqqua025 quantize -0.1 1e+1 -> -0E+1 Inexact Rounded
  52. dqqua026 quantize -0.1 1e0 -> -0 Inexact Rounded
  53. dqqua027 quantize -0.1 1e-1 -> -0.1
  54. dqqua028 quantize -0.1 1e-2 -> -0.10
  55. dqqua029 quantize -0.1 1e-3 -> -0.100
  56. dqqua030 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
  57. dqqua031 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
  58. dqqua032 quantize -0.9 1e+0 -> -1 Inexact Rounded
  59. dqqua033 quantize -0.9 1e-1 -> -0.9
  60. dqqua034 quantize -0.9 1e-2 -> -0.90
  61. dqqua035 quantize -0.9 1e-3 -> -0.900
  62. dqqua036 quantize -0.5 1e+2 -> -0E+2 Inexact Rounded
  63. dqqua037 quantize -0.5 1e+1 -> -0E+1 Inexact Rounded
  64. dqqua038 quantize -0.5 1e+0 -> -0 Inexact Rounded
  65. dqqua039 quantize -0.5 1e-1 -> -0.5
  66. dqqua040 quantize -0.5 1e-2 -> -0.50
  67. dqqua041 quantize -0.5 1e-3 -> -0.500
  68. dqqua042 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
  69. dqqua043 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
  70. dqqua044 quantize -0.9 1e+0 -> -1 Inexact Rounded
  71. dqqua045 quantize -0.9 1e-1 -> -0.9
  72. dqqua046 quantize -0.9 1e-2 -> -0.90
  73. dqqua047 quantize -0.9 1e-3 -> -0.900
  74. -- examples from Specification
  75. dqqua060 quantize 2.17 0.001 -> 2.170
  76. dqqua061 quantize 2.17 0.01 -> 2.17
  77. dqqua062 quantize 2.17 0.1 -> 2.2 Inexact Rounded
  78. dqqua063 quantize 2.17 1e+0 -> 2 Inexact Rounded
  79. dqqua064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded
  80. dqqua065 quantize -Inf Inf -> -Infinity
  81. dqqua066 quantize 2 Inf -> NaN Invalid_operation
  82. dqqua067 quantize -0.1 1 -> -0 Inexact Rounded
  83. dqqua068 quantize -0 1e+5 -> -0E+5
  84. dqqua069 quantize +123451234567899876543216789012345.6 1e-2 -> NaN Invalid_operation
  85. dqqua070 quantize -987651234567899876543214335236450.6 1e-2 -> NaN Invalid_operation
  86. dqqua071 quantize 217 1e-1 -> 217.0
  87. dqqua072 quantize 217 1e+0 -> 217
  88. dqqua073 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded
  89. dqqua074 quantize 217 1e+2 -> 2E+2 Inexact Rounded
  90. -- general tests ..
  91. dqqua089 quantize 12 1e+4 -> 0E+4 Inexact Rounded
  92. dqqua090 quantize 12 1e+3 -> 0E+3 Inexact Rounded
  93. dqqua091 quantize 12 1e+2 -> 0E+2 Inexact Rounded
  94. dqqua092 quantize 12 1e+1 -> 1E+1 Inexact Rounded
  95. dqqua093 quantize 1.2345 1e-2 -> 1.23 Inexact Rounded
  96. dqqua094 quantize 1.2355 1e-2 -> 1.24 Inexact Rounded
  97. dqqua095 quantize 1.2345 1e-6 -> 1.234500
  98. dqqua096 quantize 9.9999 1e-2 -> 10.00 Inexact Rounded
  99. dqqua097 quantize 0.0001 1e-2 -> 0.00 Inexact Rounded
  100. dqqua098 quantize 0.001 1e-2 -> 0.00 Inexact Rounded
  101. dqqua099 quantize 0.009 1e-2 -> 0.01 Inexact Rounded
  102. dqqua100 quantize 92 1e+2 -> 1E+2 Inexact Rounded
  103. dqqua101 quantize -1 1e0 -> -1
  104. dqqua102 quantize -1 1e-1 -> -1.0
  105. dqqua103 quantize -1 1e-2 -> -1.00
  106. dqqua104 quantize 0 1e0 -> 0
  107. dqqua105 quantize 0 1e-1 -> 0.0
  108. dqqua106 quantize 0 1e-2 -> 0.00
  109. dqqua107 quantize 0.00 1e0 -> 0
  110. dqqua108 quantize 0 1e+1 -> 0E+1
  111. dqqua109 quantize 0 1e+2 -> 0E+2
  112. dqqua110 quantize +1 1e0 -> 1
  113. dqqua111 quantize +1 1e-1 -> 1.0
  114. dqqua112 quantize +1 1e-2 -> 1.00
  115. dqqua120 quantize 1.04 1e-3 -> 1.040
  116. dqqua121 quantize 1.04 1e-2 -> 1.04
  117. dqqua122 quantize 1.04 1e-1 -> 1.0 Inexact Rounded
  118. dqqua123 quantize 1.04 1e0 -> 1 Inexact Rounded
  119. dqqua124 quantize 1.05 1e-3 -> 1.050
  120. dqqua125 quantize 1.05 1e-2 -> 1.05
  121. dqqua126 quantize 1.05 1e-1 -> 1.0 Inexact Rounded
  122. dqqua131 quantize 1.05 1e0 -> 1 Inexact Rounded
  123. dqqua132 quantize 1.06 1e-3 -> 1.060
  124. dqqua133 quantize 1.06 1e-2 -> 1.06
  125. dqqua134 quantize 1.06 1e-1 -> 1.1 Inexact Rounded
  126. dqqua135 quantize 1.06 1e0 -> 1 Inexact Rounded
  127. dqqua140 quantize -10 1e-2 -> -10.00
  128. dqqua141 quantize +1 1e-2 -> 1.00
  129. dqqua142 quantize +10 1e-2 -> 10.00
  130. dqqua143 quantize 1E+37 1e-2 -> NaN Invalid_operation
  131. dqqua144 quantize 1E-37 1e-2 -> 0.00 Inexact Rounded
  132. dqqua145 quantize 1E-3 1e-2 -> 0.00 Inexact Rounded
  133. dqqua146 quantize 1E-2 1e-2 -> 0.01
  134. dqqua147 quantize 1E-1 1e-2 -> 0.10
  135. dqqua148 quantize 0E-37 1e-2 -> 0.00
  136. dqqua150 quantize 1.0600 1e-5 -> 1.06000
  137. dqqua151 quantize 1.0600 1e-4 -> 1.0600
  138. dqqua152 quantize 1.0600 1e-3 -> 1.060 Rounded
  139. dqqua153 quantize 1.0600 1e-2 -> 1.06 Rounded
  140. dqqua154 quantize 1.0600 1e-1 -> 1.1 Inexact Rounded
  141. dqqua155 quantize 1.0600 1e0 -> 1 Inexact Rounded
  142. -- a couple where rounding was different in base tests
  143. rounding: half_up
  144. dqqua157 quantize -0.5 1e+0 -> -1 Inexact Rounded
  145. dqqua158 quantize 1.05 1e-1 -> 1.1 Inexact Rounded
  146. dqqua159 quantize 1.06 1e0 -> 1 Inexact Rounded
  147. rounding: half_even
  148. -- base tests with non-1 coefficients
  149. dqqua161 quantize 0 -9e0 -> 0
  150. dqqua162 quantize 1 -7e0 -> 1
  151. dqqua163 quantize 0.1 -1e+2 -> 0E+2 Inexact Rounded
  152. dqqua165 quantize 0.1 0e+1 -> 0E+1 Inexact Rounded
  153. dqqua166 quantize 0.1 2e0 -> 0 Inexact Rounded
  154. dqqua167 quantize 0.1 3e-1 -> 0.1
  155. dqqua168 quantize 0.1 44e-2 -> 0.10
  156. dqqua169 quantize 0.1 555e-3 -> 0.100
  157. dqqua170 quantize 0.9 6666e+2 -> 0E+2 Inexact Rounded
  158. dqqua171 quantize 0.9 -777e+1 -> 0E+1 Inexact Rounded
  159. dqqua172 quantize 0.9 -88e+0 -> 1 Inexact Rounded
  160. dqqua173 quantize 0.9 -9e-1 -> 0.9
  161. dqqua174 quantize 0.9 0e-2 -> 0.90
  162. dqqua175 quantize 0.9 1.1e-3 -> 0.9000
  163. -- negatives
  164. dqqua181 quantize -0 1.1e0 -> -0.0
  165. dqqua182 quantize -1 -1e0 -> -1
  166. dqqua183 quantize -0.1 11e+2 -> -0E+2 Inexact Rounded
  167. dqqua185 quantize -0.1 111e+1 -> -0E+1 Inexact Rounded
  168. dqqua186 quantize -0.1 71e0 -> -0 Inexact Rounded
  169. dqqua187 quantize -0.1 -91e-1 -> -0.1
  170. dqqua188 quantize -0.1 -.1e-2 -> -0.100
  171. dqqua189 quantize -0.1 -1e-3 -> -0.100
  172. dqqua190 quantize -0.9 0e+2 -> -0E+2 Inexact Rounded
  173. dqqua191 quantize -0.9 -0e+1 -> -0E+1 Inexact Rounded
  174. dqqua192 quantize -0.9 -10e+0 -> -1 Inexact Rounded
  175. dqqua193 quantize -0.9 100e-1 -> -0.9
  176. dqqua194 quantize -0.9 999e-2 -> -0.90
  177. -- +ve exponents ..
  178. dqqua201 quantize -1 1e+0 -> -1
  179. dqqua202 quantize -1 1e+1 -> -0E+1 Inexact Rounded
  180. dqqua203 quantize -1 1e+2 -> -0E+2 Inexact Rounded
  181. dqqua204 quantize 0 1e+0 -> 0
  182. dqqua205 quantize 0 1e+1 -> 0E+1
  183. dqqua206 quantize 0 1e+2 -> 0E+2
  184. dqqua207 quantize +1 1e+0 -> 1
  185. dqqua208 quantize +1 1e+1 -> 0E+1 Inexact Rounded
  186. dqqua209 quantize +1 1e+2 -> 0E+2 Inexact Rounded
  187. dqqua220 quantize 1.04 1e+3 -> 0E+3 Inexact Rounded
  188. dqqua221 quantize 1.04 1e+2 -> 0E+2 Inexact Rounded
  189. dqqua222 quantize 1.04 1e+1 -> 0E+1 Inexact Rounded
  190. dqqua223 quantize 1.04 1e+0 -> 1 Inexact Rounded
  191. dqqua224 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
  192. dqqua225 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
  193. dqqua226 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
  194. dqqua227 quantize 1.05 1e+0 -> 1 Inexact Rounded
  195. dqqua228 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
  196. dqqua229 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
  197. dqqua230 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
  198. dqqua231 quantize 1.05 1e+0 -> 1 Inexact Rounded
  199. dqqua232 quantize 1.06 1e+3 -> 0E+3 Inexact Rounded
  200. dqqua233 quantize 1.06 1e+2 -> 0E+2 Inexact Rounded
  201. dqqua234 quantize 1.06 1e+1 -> 0E+1 Inexact Rounded
  202. dqqua235 quantize 1.06 1e+0 -> 1 Inexact Rounded
  203. dqqua240 quantize -10 1e+1 -> -1E+1 Rounded
  204. dqqua241 quantize +1 1e+1 -> 0E+1 Inexact Rounded
  205. dqqua242 quantize +10 1e+1 -> 1E+1 Rounded
  206. dqqua243 quantize 1E+1 1e+1 -> 1E+1 -- underneath this is E+1
  207. dqqua244 quantize 1E+2 1e+1 -> 1.0E+2 -- underneath this is E+1
  208. dqqua245 quantize 1E+3 1e+1 -> 1.00E+3 -- underneath this is E+1
  209. dqqua246 quantize 1E+4 1e+1 -> 1.000E+4 -- underneath this is E+1
  210. dqqua247 quantize 1E+5 1e+1 -> 1.0000E+5 -- underneath this is E+1
  211. dqqua248 quantize 1E+6 1e+1 -> 1.00000E+6 -- underneath this is E+1
  212. dqqua249 quantize 1E+7 1e+1 -> 1.000000E+7 -- underneath this is E+1
  213. dqqua250 quantize 1E+8 1e+1 -> 1.0000000E+8 -- underneath this is E+1
  214. dqqua251 quantize 1E+9 1e+1 -> 1.00000000E+9 -- underneath this is E+1
  215. -- next one tries to add 9 zeros
  216. dqqua252 quantize 1E+37 1e+1 -> NaN Invalid_operation
  217. dqqua253 quantize 1E-37 1e+1 -> 0E+1 Inexact Rounded
  218. dqqua254 quantize 1E-2 1e+1 -> 0E+1 Inexact Rounded
  219. dqqua255 quantize 0E-37 1e+1 -> 0E+1
  220. dqqua256 quantize -0E-37 1e+1 -> -0E+1
  221. dqqua257 quantize -0E-1 1e+1 -> -0E+1
  222. dqqua258 quantize -0 1e+1 -> -0E+1
  223. dqqua259 quantize -0E+1 1e+1 -> -0E+1
  224. dqqua260 quantize -10 1e+2 -> -0E+2 Inexact Rounded
  225. dqqua261 quantize +1 1e+2 -> 0E+2 Inexact Rounded
  226. dqqua262 quantize +10 1e+2 -> 0E+2 Inexact Rounded
  227. dqqua263 quantize 1E+1 1e+2 -> 0E+2 Inexact Rounded
  228. dqqua264 quantize 1E+2 1e+2 -> 1E+2
  229. dqqua265 quantize 1E+3 1e+2 -> 1.0E+3
  230. dqqua266 quantize 1E+4 1e+2 -> 1.00E+4
  231. dqqua267 quantize 1E+5 1e+2 -> 1.000E+5
  232. dqqua268 quantize 1E+6 1e+2 -> 1.0000E+6
  233. dqqua269 quantize 1E+7 1e+2 -> 1.00000E+7
  234. dqqua270 quantize 1E+8 1e+2 -> 1.000000E+8
  235. dqqua271 quantize 1E+9 1e+2 -> 1.0000000E+9
  236. dqqua272 quantize 1E+10 1e+2 -> 1.00000000E+10
  237. dqqua273 quantize 1E-10 1e+2 -> 0E+2 Inexact Rounded
  238. dqqua274 quantize 1E-2 1e+2 -> 0E+2 Inexact Rounded
  239. dqqua275 quantize 0E-10 1e+2 -> 0E+2
  240. dqqua280 quantize -10 1e+3 -> -0E+3 Inexact Rounded
  241. dqqua281 quantize +1 1e+3 -> 0E+3 Inexact Rounded
  242. dqqua282 quantize +10 1e+3 -> 0E+3 Inexact Rounded
  243. dqqua283 quantize 1E+1 1e+3 -> 0E+3 Inexact Rounded
  244. dqqua284 quantize 1E+2 1e+3 -> 0E+3 Inexact Rounded
  245. dqqua285 quantize 1E+3 1e+3 -> 1E+3
  246. dqqua286 quantize 1E+4 1e+3 -> 1.0E+4
  247. dqqua287 quantize 1E+5 1e+3 -> 1.00E+5
  248. dqqua288 quantize 1E+6 1e+3 -> 1.000E+6
  249. dqqua289 quantize 1E+7 1e+3 -> 1.0000E+7
  250. dqqua290 quantize 1E+8 1e+3 -> 1.00000E+8
  251. dqqua291 quantize 1E+9 1e+3 -> 1.000000E+9
  252. dqqua292 quantize 1E+10 1e+3 -> 1.0000000E+10
  253. dqqua293 quantize 1E-10 1e+3 -> 0E+3 Inexact Rounded
  254. dqqua294 quantize 1E-2 1e+3 -> 0E+3 Inexact Rounded
  255. dqqua295 quantize 0E-10 1e+3 -> 0E+3
  256. -- round up from below [sign wrong in JIT compiler once]
  257. dqqua300 quantize 0.0078 1e-5 -> 0.00780
  258. dqqua301 quantize 0.0078 1e-4 -> 0.0078
  259. dqqua302 quantize 0.0078 1e-3 -> 0.008 Inexact Rounded
  260. dqqua303 quantize 0.0078 1e-2 -> 0.01 Inexact Rounded
  261. dqqua304 quantize 0.0078 1e-1 -> 0.0 Inexact Rounded
  262. dqqua305 quantize 0.0078 1e0 -> 0 Inexact Rounded
  263. dqqua306 quantize 0.0078 1e+1 -> 0E+1 Inexact Rounded
  264. dqqua307 quantize 0.0078 1e+2 -> 0E+2 Inexact Rounded
  265. dqqua310 quantize -0.0078 1e-5 -> -0.00780
  266. dqqua311 quantize -0.0078 1e-4 -> -0.0078
  267. dqqua312 quantize -0.0078 1e-3 -> -0.008 Inexact Rounded
  268. dqqua313 quantize -0.0078 1e-2 -> -0.01 Inexact Rounded
  269. dqqua314 quantize -0.0078 1e-1 -> -0.0 Inexact Rounded
  270. dqqua315 quantize -0.0078 1e0 -> -0 Inexact Rounded
  271. dqqua316 quantize -0.0078 1e+1 -> -0E+1 Inexact Rounded
  272. dqqua317 quantize -0.0078 1e+2 -> -0E+2 Inexact Rounded
  273. dqqua320 quantize 0.078 1e-5 -> 0.07800
  274. dqqua321 quantize 0.078 1e-4 -> 0.0780
  275. dqqua322 quantize 0.078 1e-3 -> 0.078
  276. dqqua323 quantize 0.078 1e-2 -> 0.08 Inexact Rounded
  277. dqqua324 quantize 0.078 1e-1 -> 0.1 Inexact Rounded
  278. dqqua325 quantize 0.078 1e0 -> 0 Inexact Rounded
  279. dqqua326 quantize 0.078 1e+1 -> 0E+1 Inexact Rounded
  280. dqqua327 quantize 0.078 1e+2 -> 0E+2 Inexact Rounded
  281. dqqua330 quantize -0.078 1e-5 -> -0.07800
  282. dqqua331 quantize -0.078 1e-4 -> -0.0780
  283. dqqua332 quantize -0.078 1e-3 -> -0.078
  284. dqqua333 quantize -0.078 1e-2 -> -0.08 Inexact Rounded
  285. dqqua334 quantize -0.078 1e-1 -> -0.1 Inexact Rounded
  286. dqqua335 quantize -0.078 1e0 -> -0 Inexact Rounded
  287. dqqua336 quantize -0.078 1e+1 -> -0E+1 Inexact Rounded
  288. dqqua337 quantize -0.078 1e+2 -> -0E+2 Inexact Rounded
  289. dqqua340 quantize 0.78 1e-5 -> 0.78000
  290. dqqua341 quantize 0.78 1e-4 -> 0.7800
  291. dqqua342 quantize 0.78 1e-3 -> 0.780
  292. dqqua343 quantize 0.78 1e-2 -> 0.78
  293. dqqua344 quantize 0.78 1e-1 -> 0.8 Inexact Rounded
  294. dqqua345 quantize 0.78 1e0 -> 1 Inexact Rounded
  295. dqqua346 quantize 0.78 1e+1 -> 0E+1 Inexact Rounded
  296. dqqua347 quantize 0.78 1e+2 -> 0E+2 Inexact Rounded
  297. dqqua350 quantize -0.78 1e-5 -> -0.78000
  298. dqqua351 quantize -0.78 1e-4 -> -0.7800
  299. dqqua352 quantize -0.78 1e-3 -> -0.780
  300. dqqua353 quantize -0.78 1e-2 -> -0.78
  301. dqqua354 quantize -0.78 1e-1 -> -0.8 Inexact Rounded
  302. dqqua355 quantize -0.78 1e0 -> -1 Inexact Rounded
  303. dqqua356 quantize -0.78 1e+1 -> -0E+1 Inexact Rounded
  304. dqqua357 quantize -0.78 1e+2 -> -0E+2 Inexact Rounded
  305. dqqua360 quantize 7.8 1e-5 -> 7.80000
  306. dqqua361 quantize 7.8 1e-4 -> 7.8000
  307. dqqua362 quantize 7.8 1e-3 -> 7.800
  308. dqqua363 quantize 7.8 1e-2 -> 7.80
  309. dqqua364 quantize 7.8 1e-1 -> 7.8
  310. dqqua365 quantize 7.8 1e0 -> 8 Inexact Rounded
  311. dqqua366 quantize 7.8 1e+1 -> 1E+1 Inexact Rounded
  312. dqqua367 quantize 7.8 1e+2 -> 0E+2 Inexact Rounded
  313. dqqua368 quantize 7.8 1e+3 -> 0E+3 Inexact Rounded
  314. dqqua370 quantize -7.8 1e-5 -> -7.80000
  315. dqqua371 quantize -7.8 1e-4 -> -7.8000
  316. dqqua372 quantize -7.8 1e-3 -> -7.800
  317. dqqua373 quantize -7.8 1e-2 -> -7.80
  318. dqqua374 quantize -7.8 1e-1 -> -7.8
  319. dqqua375 quantize -7.8 1e0 -> -8 Inexact Rounded
  320. dqqua376 quantize -7.8 1e+1 -> -1E+1 Inexact Rounded
  321. dqqua377 quantize -7.8 1e+2 -> -0E+2 Inexact Rounded
  322. dqqua378 quantize -7.8 1e+3 -> -0E+3 Inexact Rounded
  323. -- some individuals
  324. dqqua380 quantize 1122334455667788991234567352364.506 1e-2 -> 1122334455667788991234567352364.51 Inexact Rounded
  325. dqqua381 quantize 11223344556677889912345673523645.06 1e-2 -> 11223344556677889912345673523645.06
  326. dqqua382 quantize 112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation
  327. dqqua383 quantize 1122334455667788991234567352364506 1e-2 -> NaN Invalid_operation
  328. dqqua384 quantize -1122334455667788991234567352364.506 1e-2 -> -1122334455667788991234567352364.51 Inexact Rounded
  329. dqqua385 quantize -11223344556677889912345673523645.06 1e-2 -> -11223344556677889912345673523645.06
  330. dqqua386 quantize -112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation
  331. dqqua387 quantize -1122334455667788991234567352364506 1e-2 -> NaN Invalid_operation
  332. rounding: down
  333. dqqua389 quantize 112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation
  334. rounding: half_up
  335. -- and a few more from e-mail discussions
  336. dqqua391 quantize 11223344556677889912345678912.34567 1e-3 -> 11223344556677889912345678912.346 Inexact Rounded
  337. dqqua392 quantize 112233445566778899123456789123.4567 1e-3 -> 112233445566778899123456789123.457 Inexact Rounded
  338. dqqua393 quantize 1122334455667788991234567891234567. 1e-3 -> NaN Invalid_operation
  339. -- some 9999 round-up cases
  340. dqqua400 quantize 9.999 1e-5 -> 9.99900
  341. dqqua401 quantize 9.999 1e-4 -> 9.9990
  342. dqqua402 quantize 9.999 1e-3 -> 9.999
  343. dqqua403 quantize 9.999 1e-2 -> 10.00 Inexact Rounded
  344. dqqua404 quantize 9.999 1e-1 -> 10.0 Inexact Rounded
  345. dqqua405 quantize 9.999 1e0 -> 10 Inexact Rounded
  346. dqqua406 quantize 9.999 1e1 -> 1E+1 Inexact Rounded
  347. dqqua407 quantize 9.999 1e2 -> 0E+2 Inexact Rounded
  348. dqqua410 quantize 0.999 1e-5 -> 0.99900
  349. dqqua411 quantize 0.999 1e-4 -> 0.9990
  350. dqqua412 quantize 0.999 1e-3 -> 0.999
  351. dqqua413 quantize 0.999 1e-2 -> 1.00 Inexact Rounded
  352. dqqua414 quantize 0.999 1e-1 -> 1.0 Inexact Rounded
  353. dqqua415 quantize 0.999 1e0 -> 1 Inexact Rounded
  354. dqqua416 quantize 0.999 1e1 -> 0E+1 Inexact Rounded
  355. dqqua420 quantize 0.0999 1e-5 -> 0.09990
  356. dqqua421 quantize 0.0999 1e-4 -> 0.0999
  357. dqqua422 quantize 0.0999 1e-3 -> 0.100 Inexact Rounded
  358. dqqua423 quantize 0.0999 1e-2 -> 0.10 Inexact Rounded
  359. dqqua424 quantize 0.0999 1e-1 -> 0.1 Inexact Rounded
  360. dqqua425 quantize 0.0999 1e0 -> 0 Inexact Rounded
  361. dqqua426 quantize 0.0999 1e1 -> 0E+1 Inexact Rounded
  362. dqqua430 quantize 0.00999 1e-5 -> 0.00999
  363. dqqua431 quantize 0.00999 1e-4 -> 0.0100 Inexact Rounded
  364. dqqua432 quantize 0.00999 1e-3 -> 0.010 Inexact Rounded
  365. dqqua433 quantize 0.00999 1e-2 -> 0.01 Inexact Rounded
  366. dqqua434 quantize 0.00999 1e-1 -> 0.0 Inexact Rounded
  367. dqqua435 quantize 0.00999 1e0 -> 0 Inexact Rounded
  368. dqqua436 quantize 0.00999 1e1 -> 0E+1 Inexact Rounded
  369. dqqua440 quantize 0.000999 1e-5 -> 0.00100 Inexact Rounded
  370. dqqua441 quantize 0.000999 1e-4 -> 0.0010 Inexact Rounded
  371. dqqua442 quantize 0.000999 1e-3 -> 0.001 Inexact Rounded
  372. dqqua443 quantize 0.000999 1e-2 -> 0.00 Inexact Rounded
  373. dqqua444 quantize 0.000999 1e-1 -> 0.0 Inexact Rounded
  374. dqqua445 quantize 0.000999 1e0 -> 0 Inexact Rounded
  375. dqqua446 quantize 0.000999 1e1 -> 0E+1 Inexact Rounded
  376. dqqua1001 quantize 0.000 0.001 -> 0.000
  377. dqqua1002 quantize 0.001 0.001 -> 0.001
  378. dqqua1003 quantize 0.0012 0.001 -> 0.001 Inexact Rounded
  379. dqqua1004 quantize 0.0018 0.001 -> 0.002 Inexact Rounded
  380. dqqua1005 quantize 0.501 0.001 -> 0.501
  381. dqqua1006 quantize 0.5012 0.001 -> 0.501 Inexact Rounded
  382. dqqua1007 quantize 0.5018 0.001 -> 0.502 Inexact Rounded
  383. dqqua1008 quantize 0.999 0.001 -> 0.999
  384. dqqua481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
  385. dqqua482 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
  386. dqqua483 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
  387. dqqua484 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
  388. dqqua485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
  389. dqqua486 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
  390. -- a potential double-round
  391. dqqua487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
  392. dqqua488 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
  393. dqqua491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
  394. dqqua492 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
  395. dqqua493 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
  396. dqqua494 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
  397. dqqua495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
  398. dqqua496 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
  399. dqqua497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
  400. dqqua498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
  401. -- Zeros
  402. dqqua500 quantize 0 1e1 -> 0E+1
  403. dqqua501 quantize 0 1e0 -> 0
  404. dqqua502 quantize 0 1e-1 -> 0.0
  405. dqqua503 quantize 0.0 1e-1 -> 0.0
  406. dqqua504 quantize 0.0 1e0 -> 0
  407. dqqua505 quantize 0.0 1e+1 -> 0E+1
  408. dqqua506 quantize 0E+1 1e-1 -> 0.0
  409. dqqua507 quantize 0E+1 1e0 -> 0
  410. dqqua508 quantize 0E+1 1e+1 -> 0E+1
  411. dqqua509 quantize -0 1e1 -> -0E+1
  412. dqqua510 quantize -0 1e0 -> -0
  413. dqqua511 quantize -0 1e-1 -> -0.0
  414. dqqua512 quantize -0.0 1e-1 -> -0.0
  415. dqqua513 quantize -0.0 1e0 -> -0
  416. dqqua514 quantize -0.0 1e+1 -> -0E+1
  417. dqqua515 quantize -0E+1 1e-1 -> -0.0
  418. dqqua516 quantize -0E+1 1e0 -> -0
  419. dqqua517 quantize -0E+1 1e+1 -> -0E+1
  420. -- #519 here once a problem
  421. dqqua518 quantize 0 0E-3 -> 0.000
  422. dqqua519 quantize 0 0E-33 -> 0E-33
  423. dqqua520 quantize 0.00000000000000000000000000000000 0E-33 -> 0E-33
  424. dqqua521 quantize 0.000000000000000000000000000000000 0E-33 -> 0E-33
  425. -- Some non-zeros with lots of padding on the right
  426. dqqua523 quantize 1 0E-33 -> 1.000000000000000000000000000000000
  427. dqqua524 quantize 12 0E-32 -> 12.00000000000000000000000000000000
  428. dqqua525 quantize 123 0E-31 -> 123.0000000000000000000000000000000
  429. dqqua526 quantize 123 0E-32 -> NaN Invalid_operation
  430. dqqua527 quantize 123.4 0E-31 -> 123.4000000000000000000000000000000
  431. dqqua528 quantize 123.4 0E-32 -> NaN Invalid_operation
  432. -- Suspicious RHS values
  433. dqqua530 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
  434. dqqua531 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
  435. dqqua532 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
  436. dqqua533 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
  437. -- next four are "won't fit" overflows
  438. dqqua536 quantize 1.234 1e-299 -> NaN Invalid_operation
  439. dqqua537 quantize 123.456 1e-299 -> NaN Invalid_operation
  440. dqqua538 quantize 1.234 1e-299 -> NaN Invalid_operation
  441. dqqua539 quantize 123.456 1e-299 -> NaN Invalid_operation
  442. dqqua542 quantize 1.234E+299 1e299 -> 1E+299 Inexact Rounded
  443. dqqua543 quantize 1.234E+298 1e299 -> 0E+299 Inexact Rounded
  444. dqqua544 quantize 1.234 1e299 -> 0E+299 Inexact Rounded
  445. dqqua547 quantize 0 1e-299 -> 0E-299
  446. -- next two are "won't fit" overflows
  447. dqqua548 quantize 1.234 1e-299 -> NaN Invalid_operation
  448. dqqua549 quantize 1.234 1e-300 -> NaN Invalid_operation
  449. -- [more below]
  450. -- Specials
  451. dqqua580 quantize Inf -Inf -> Infinity
  452. dqqua581 quantize Inf 1e-299 -> NaN Invalid_operation
  453. dqqua582 quantize Inf 1e-1 -> NaN Invalid_operation
  454. dqqua583 quantize Inf 1e0 -> NaN Invalid_operation
  455. dqqua584 quantize Inf 1e1 -> NaN Invalid_operation
  456. dqqua585 quantize Inf 1e299 -> NaN Invalid_operation
  457. dqqua586 quantize Inf Inf -> Infinity
  458. dqqua587 quantize -1000 Inf -> NaN Invalid_operation
  459. dqqua588 quantize -Inf Inf -> -Infinity
  460. dqqua589 quantize -1 Inf -> NaN Invalid_operation
  461. dqqua590 quantize 0 Inf -> NaN Invalid_operation
  462. dqqua591 quantize 1 Inf -> NaN Invalid_operation
  463. dqqua592 quantize 1000 Inf -> NaN Invalid_operation
  464. dqqua593 quantize Inf Inf -> Infinity
  465. dqqua594 quantize Inf 1e-0 -> NaN Invalid_operation
  466. dqqua595 quantize -0 Inf -> NaN Invalid_operation
  467. dqqua600 quantize -Inf -Inf -> -Infinity
  468. dqqua601 quantize -Inf 1e-299 -> NaN Invalid_operation
  469. dqqua602 quantize -Inf 1e-1 -> NaN Invalid_operation
  470. dqqua603 quantize -Inf 1e0 -> NaN Invalid_operation
  471. dqqua604 quantize -Inf 1e1 -> NaN Invalid_operation
  472. dqqua605 quantize -Inf 1e299 -> NaN Invalid_operation
  473. dqqua606 quantize -Inf Inf -> -Infinity
  474. dqqua607 quantize -1000 Inf -> NaN Invalid_operation
  475. dqqua608 quantize -Inf -Inf -> -Infinity
  476. dqqua609 quantize -1 -Inf -> NaN Invalid_operation
  477. dqqua610 quantize 0 -Inf -> NaN Invalid_operation
  478. dqqua611 quantize 1 -Inf -> NaN Invalid_operation
  479. dqqua612 quantize 1000 -Inf -> NaN Invalid_operation
  480. dqqua613 quantize Inf -Inf -> Infinity
  481. dqqua614 quantize -Inf 1e-0 -> NaN Invalid_operation
  482. dqqua615 quantize -0 -Inf -> NaN Invalid_operation
  483. dqqua621 quantize NaN -Inf -> NaN
  484. dqqua622 quantize NaN 1e-299 -> NaN
  485. dqqua623 quantize NaN 1e-1 -> NaN
  486. dqqua624 quantize NaN 1e0 -> NaN
  487. dqqua625 quantize NaN 1e1 -> NaN
  488. dqqua626 quantize NaN 1e299 -> NaN
  489. dqqua627 quantize NaN Inf -> NaN
  490. dqqua628 quantize NaN NaN -> NaN
  491. dqqua629 quantize -Inf NaN -> NaN
  492. dqqua630 quantize -1000 NaN -> NaN
  493. dqqua631 quantize -1 NaN -> NaN
  494. dqqua632 quantize 0 NaN -> NaN
  495. dqqua633 quantize 1 NaN -> NaN
  496. dqqua634 quantize 1000 NaN -> NaN
  497. dqqua635 quantize Inf NaN -> NaN
  498. dqqua636 quantize NaN 1e-0 -> NaN
  499. dqqua637 quantize -0 NaN -> NaN
  500. dqqua641 quantize sNaN -Inf -> NaN Invalid_operation
  501. dqqua642 quantize sNaN 1e-299 -> NaN Invalid_operation
  502. dqqua643 quantize sNaN 1e-1 -> NaN Invalid_operation
  503. dqqua644 quantize sNaN 1e0 -> NaN Invalid_operation
  504. dqqua645 quantize sNaN 1e1 -> NaN Invalid_operation
  505. dqqua646 quantize sNaN 1e299 -> NaN Invalid_operation
  506. dqqua647 quantize sNaN NaN -> NaN Invalid_operation
  507. dqqua648 quantize sNaN sNaN -> NaN Invalid_operation
  508. dqqua649 quantize NaN sNaN -> NaN Invalid_operation
  509. dqqua650 quantize -Inf sNaN -> NaN Invalid_operation
  510. dqqua651 quantize -1000 sNaN -> NaN Invalid_operation
  511. dqqua652 quantize -1 sNaN -> NaN Invalid_operation
  512. dqqua653 quantize 0 sNaN -> NaN Invalid_operation
  513. dqqua654 quantize 1 sNaN -> NaN Invalid_operation
  514. dqqua655 quantize 1000 sNaN -> NaN Invalid_operation
  515. dqqua656 quantize Inf sNaN -> NaN Invalid_operation
  516. dqqua657 quantize NaN sNaN -> NaN Invalid_operation
  517. dqqua658 quantize sNaN 1e-0 -> NaN Invalid_operation
  518. dqqua659 quantize -0 sNaN -> NaN Invalid_operation
  519. -- propagating NaNs
  520. dqqua661 quantize NaN9 -Inf -> NaN9
  521. dqqua662 quantize NaN8 919 -> NaN8
  522. dqqua663 quantize NaN71 Inf -> NaN71
  523. dqqua664 quantize NaN6 NaN5 -> NaN6
  524. dqqua665 quantize -Inf NaN4 -> NaN4
  525. dqqua666 quantize -919 NaN31 -> NaN31
  526. dqqua667 quantize Inf NaN2 -> NaN2
  527. dqqua671 quantize sNaN99 -Inf -> NaN99 Invalid_operation
  528. dqqua672 quantize sNaN98 -11 -> NaN98 Invalid_operation
  529. dqqua673 quantize sNaN97 NaN -> NaN97 Invalid_operation
  530. dqqua674 quantize sNaN16 sNaN94 -> NaN16 Invalid_operation
  531. dqqua675 quantize NaN95 sNaN93 -> NaN93 Invalid_operation
  532. dqqua676 quantize -Inf sNaN92 -> NaN92 Invalid_operation
  533. dqqua677 quantize 088 sNaN91 -> NaN91 Invalid_operation
  534. dqqua678 quantize Inf sNaN90 -> NaN90 Invalid_operation
  535. dqqua679 quantize NaN sNaN88 -> NaN88 Invalid_operation
  536. dqqua681 quantize -NaN9 -Inf -> -NaN9
  537. dqqua682 quantize -NaN8 919 -> -NaN8
  538. dqqua683 quantize -NaN71 Inf -> -NaN71
  539. dqqua684 quantize -NaN6 -NaN5 -> -NaN6
  540. dqqua685 quantize -Inf -NaN4 -> -NaN4
  541. dqqua686 quantize -919 -NaN31 -> -NaN31
  542. dqqua687 quantize Inf -NaN2 -> -NaN2
  543. dqqua691 quantize -sNaN99 -Inf -> -NaN99 Invalid_operation
  544. dqqua692 quantize -sNaN98 -11 -> -NaN98 Invalid_operation
  545. dqqua693 quantize -sNaN97 NaN -> -NaN97 Invalid_operation
  546. dqqua694 quantize -sNaN16 sNaN94 -> -NaN16 Invalid_operation
  547. dqqua695 quantize -NaN95 -sNaN93 -> -NaN93 Invalid_operation
  548. dqqua696 quantize -Inf -sNaN92 -> -NaN92 Invalid_operation
  549. dqqua697 quantize 088 -sNaN91 -> -NaN91 Invalid_operation
  550. dqqua698 quantize Inf -sNaN90 -> -NaN90 Invalid_operation
  551. dqqua699 quantize NaN -sNaN88 -> -NaN88 Invalid_operation
  552. -- subnormals and underflow
  553. dqqua710 quantize 1.00E-6143 1e-6143 -> 1E-6143 Rounded
  554. dqqua711 quantize 0.1E-6143 2e-6144 -> 1E-6144 Subnormal
  555. dqqua712 quantize 0.10E-6143 3e-6144 -> 1E-6144 Subnormal Rounded
  556. dqqua713 quantize 0.100E-6143 4e-6144 -> 1E-6144 Subnormal Rounded
  557. dqqua714 quantize 0.01E-6143 5e-6145 -> 1E-6145 Subnormal
  558. -- next is rounded to Emin
  559. dqqua715 quantize 0.999E-6143 1e-6143 -> 1E-6143 Inexact Rounded
  560. dqqua716 quantize 0.099E-6143 10e-6144 -> 1E-6144 Inexact Rounded Subnormal
  561. dqqua717 quantize 0.009E-6143 1e-6145 -> 1E-6145 Inexact Rounded Subnormal
  562. dqqua718 quantize 0.001E-6143 1e-6145 -> 0E-6145 Inexact Rounded
  563. dqqua719 quantize 0.0009E-6143 1e-6145 -> 0E-6145 Inexact Rounded
  564. dqqua720 quantize 0.0001E-6143 1e-6145 -> 0E-6145 Inexact Rounded
  565. dqqua730 quantize -1.00E-6143 1e-6143 -> -1E-6143 Rounded
  566. dqqua731 quantize -0.1E-6143 1e-6143 -> -0E-6143 Rounded Inexact
  567. dqqua732 quantize -0.10E-6143 1e-6143 -> -0E-6143 Rounded Inexact
  568. dqqua733 quantize -0.100E-6143 1e-6143 -> -0E-6143 Rounded Inexact
  569. dqqua734 quantize -0.01E-6143 1e-6143 -> -0E-6143 Inexact Rounded
  570. -- next is rounded to Emin
  571. dqqua735 quantize -0.999E-6143 90e-6143 -> -1E-6143 Inexact Rounded
  572. dqqua736 quantize -0.099E-6143 -1e-6143 -> -0E-6143 Inexact Rounded
  573. dqqua737 quantize -0.009E-6143 -1e-6143 -> -0E-6143 Inexact Rounded
  574. dqqua738 quantize -0.001E-6143 -0e-6143 -> -0E-6143 Inexact Rounded
  575. dqqua739 quantize -0.0001E-6143 0e-6143 -> -0E-6143 Inexact Rounded
  576. dqqua740 quantize -1.00E-6143 1e-6144 -> -1.0E-6143 Rounded
  577. dqqua741 quantize -0.1E-6143 1e-6144 -> -1E-6144 Subnormal
  578. dqqua742 quantize -0.10E-6143 1e-6144 -> -1E-6144 Subnormal Rounded
  579. dqqua743 quantize -0.100E-6143 1e-6144 -> -1E-6144 Subnormal Rounded
  580. dqqua744 quantize -0.01E-6143 1e-6144 -> -0E-6144 Inexact Rounded
  581. -- next is rounded to Emin
  582. dqqua745 quantize -0.999E-6143 1e-6144 -> -1.0E-6143 Inexact Rounded
  583. dqqua746 quantize -0.099E-6143 1e-6144 -> -1E-6144 Inexact Rounded Subnormal
  584. dqqua747 quantize -0.009E-6143 1e-6144 -> -0E-6144 Inexact Rounded
  585. dqqua748 quantize -0.001E-6143 1e-6144 -> -0E-6144 Inexact Rounded
  586. dqqua749 quantize -0.0001E-6143 1e-6144 -> -0E-6144 Inexact Rounded
  587. dqqua750 quantize -1.00E-6143 1e-6145 -> -1.00E-6143
  588. dqqua751 quantize -0.1E-6143 1e-6145 -> -1.0E-6144 Subnormal
  589. dqqua752 quantize -0.10E-6143 1e-6145 -> -1.0E-6144 Subnormal
  590. dqqua753 quantize -0.100E-6143 1e-6145 -> -1.0E-6144 Subnormal Rounded
  591. dqqua754 quantize -0.01E-6143 1e-6145 -> -1E-6145 Subnormal
  592. -- next is rounded to Emin
  593. dqqua755 quantize -0.999E-6143 1e-6145 -> -1.00E-6143 Inexact Rounded
  594. dqqua756 quantize -0.099E-6143 1e-6145 -> -1.0E-6144 Inexact Rounded Subnormal
  595. dqqua757 quantize -0.009E-6143 1e-6145 -> -1E-6145 Inexact Rounded Subnormal
  596. dqqua758 quantize -0.001E-6143 1e-6145 -> -0E-6145 Inexact Rounded
  597. dqqua759 quantize -0.0001E-6143 1e-6145 -> -0E-6145 Inexact Rounded
  598. dqqua760 quantize -1.00E-6143 1e-6146 -> -1.000E-6143
  599. dqqua761 quantize -0.1E-6143 1e-6146 -> -1.00E-6144 Subnormal
  600. dqqua762 quantize -0.10E-6143 1e-6146 -> -1.00E-6144 Subnormal
  601. dqqua763 quantize -0.100E-6143 1e-6146 -> -1.00E-6144 Subnormal
  602. dqqua764 quantize -0.01E-6143 1e-6146 -> -1.0E-6145 Subnormal
  603. dqqua765 quantize -0.999E-6143 1e-6146 -> -9.99E-6144 Subnormal
  604. dqqua766 quantize -0.099E-6143 1e-6146 -> -9.9E-6145 Subnormal
  605. dqqua767 quantize -0.009E-6143 1e-6146 -> -9E-6146 Subnormal
  606. dqqua768 quantize -0.001E-6143 1e-6146 -> -1E-6146 Subnormal
  607. dqqua769 quantize -0.0001E-6143 1e-6146 -> -0E-6146 Inexact Rounded
  608. -- More from Fung Lee
  609. -- the next four would appear to be in error, but they are misleading (the
  610. -- operands will be clamped to a lower exponent) and so are omitted
  611. -- dqqua1021 quantize 8.666666666666000E+6144 1.000000000000000E+6144 -> 8.666666666666000000000000000000000E+6144 Clamped
  612. -- dqqua1022 quantize -8.666666666666000E+6144 1.000000000000000E+6144 -> -8.666666666666000000000000000000000E+6144 Clamped
  613. -- dqqua1027 quantize 8.666666666666000E+323 1E+31 -> NaN Invalid_operation
  614. -- dqqua1030 quantize 8.66666666E+3 1E+3 -> 9E+3 Inexact Rounded
  615. -- Int and uInt32 edge values for testing conversions
  616. dqqua1040 quantize -2147483646 0 -> -2147483646
  617. dqqua1041 quantize -2147483647 0 -> -2147483647
  618. dqqua1042 quantize -2147483648 0 -> -2147483648
  619. dqqua1043 quantize -2147483649 0 -> -2147483649
  620. dqqua1044 quantize 2147483646 0 -> 2147483646
  621. dqqua1045 quantize 2147483647 0 -> 2147483647
  622. dqqua1046 quantize 2147483648 0 -> 2147483648
  623. dqqua1047 quantize 2147483649 0 -> 2147483649
  624. dqqua1048 quantize 4294967294 0 -> 4294967294
  625. dqqua1049 quantize 4294967295 0 -> 4294967295
  626. dqqua1050 quantize 4294967296 0 -> 4294967296
  627. dqqua1051 quantize 4294967297 0 -> 4294967297
  628. -- Rounding swathe
  629. rounding: half_even
  630. dqqua1100 quantize 1.2300 1.00 -> 1.23 Rounded
  631. dqqua1101 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
  632. dqqua1102 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
  633. dqqua1103 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
  634. dqqua1104 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
  635. dqqua1105 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
  636. dqqua1106 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
  637. dqqua1107 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
  638. dqqua1108 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
  639. dqqua1109 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
  640. rounding: half_up
  641. dqqua1200 quantize 1.2300 1.00 -> 1.23 Rounded
  642. dqqua1201 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
  643. dqqua1202 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
  644. dqqua1203 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
  645. dqqua1204 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
  646. dqqua1205 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
  647. dqqua1206 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
  648. dqqua1207 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
  649. dqqua1208 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
  650. dqqua1209 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
  651. rounding: half_down
  652. dqqua1300 quantize 1.2300 1.00 -> 1.23 Rounded
  653. dqqua1301 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
  654. dqqua1302 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
  655. dqqua1303 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
  656. dqqua1304 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
  657. dqqua1305 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
  658. dqqua1306 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
  659. dqqua1307 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
  660. dqqua1308 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
  661. dqqua1309 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
  662. rounding: up
  663. dqqua1400 quantize 1.2300 1.00 -> 1.23 Rounded
  664. dqqua1401 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
  665. dqqua1402 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
  666. dqqua1403 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
  667. dqqua1404 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
  668. dqqua1405 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
  669. dqqua1406 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
  670. dqqua1407 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
  671. dqqua1408 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
  672. dqqua1409 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
  673. dqqua1411 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
  674. rounding: down
  675. dqqua1500 quantize 1.2300 1.00 -> 1.23 Rounded
  676. dqqua1501 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
  677. dqqua1502 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
  678. dqqua1503 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
  679. dqqua1504 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
  680. dqqua1505 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
  681. dqqua1506 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
  682. dqqua1507 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
  683. dqqua1508 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
  684. dqqua1509 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
  685. dqqua1511 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
  686. rounding: ceiling
  687. dqqua1600 quantize 1.2300 1.00 -> 1.23 Rounded
  688. dqqua1601 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
  689. dqqua1602 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
  690. dqqua1603 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
  691. dqqua1604 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
  692. dqqua1605 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
  693. dqqua1606 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
  694. dqqua1607 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
  695. dqqua1608 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
  696. dqqua1609 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
  697. dqqua1611 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
  698. rounding: floor
  699. dqqua1700 quantize 1.2300 1.00 -> 1.23 Rounded
  700. dqqua1701 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
  701. dqqua1702 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
  702. dqqua1703 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
  703. dqqua1704 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
  704. dqqua1705 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
  705. dqqua1706 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
  706. dqqua1707 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
  707. dqqua1708 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
  708. dqqua1709 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
  709. dqqua1711 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
  710. rounding: 05up
  711. dqqua1800 quantize 1.2000 1.00 -> 1.20 Rounded
  712. dqqua1801 quantize 1.2001 1.00 -> 1.21 Inexact Rounded
  713. dqqua1802 quantize 1.2010 1.00 -> 1.21 Inexact Rounded
  714. dqqua1803 quantize 1.2050 1.00 -> 1.21 Inexact Rounded
  715. dqqua1804 quantize 1.2051 1.00 -> 1.21 Inexact Rounded
  716. dqqua1807 quantize 1.2060 1.00 -> 1.21 Inexact Rounded
  717. dqqua1808 quantize 1.2070 1.00 -> 1.21 Inexact Rounded
  718. dqqua1809 quantize 1.2099 1.00 -> 1.21 Inexact Rounded
  719. dqqua1811 quantize -1.2099 1.00 -> -1.21 Inexact Rounded
  720. dqqua1900 quantize 1.2100 1.00 -> 1.21 Rounded
  721. dqqua1901 quantize 1.2101 1.00 -> 1.21 Inexact Rounded
  722. dqqua1902 quantize 1.2110 1.00 -> 1.21 Inexact Rounded
  723. dqqua1903 quantize 1.2150 1.00 -> 1.21 Inexact Rounded
  724. dqqua1904 quantize 1.2151 1.00 -> 1.21 Inexact Rounded
  725. dqqua1907 quantize 1.2160 1.00 -> 1.21 Inexact Rounded
  726. dqqua1908 quantize 1.2170 1.00 -> 1.21 Inexact Rounded
  727. dqqua1909 quantize 1.2199 1.00 -> 1.21 Inexact Rounded
  728. dqqua1911 quantize -1.2199 1.00 -> -1.21 Inexact Rounded
  729. dqqua2000 quantize 1.2400 1.00 -> 1.24 Rounded
  730. dqqua2001 quantize 1.2401 1.00 -> 1.24 Inexact Rounded
  731. dqqua2002 quantize 1.2410 1.00 -> 1.24 Inexact Rounded
  732. dqqua2003 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
  733. dqqua2004 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
  734. dqqua2007 quantize 1.2460 1.00 -> 1.24 Inexact Rounded
  735. dqqua2008 quantize 1.2470 1.00 -> 1.24 Inexact Rounded
  736. dqqua2009 quantize 1.2499 1.00 -> 1.24 Inexact Rounded
  737. dqqua2011 quantize -1.2499 1.00 -> -1.24 Inexact Rounded
  738. dqqua2100 quantize 1.2500 1.00 -> 1.25 Rounded
  739. dqqua2101 quantize 1.2501 1.00 -> 1.26 Inexact Rounded
  740. dqqua2102 quantize 1.2510 1.00 -> 1.26 Inexact Rounded
  741. dqqua2103 quantize 1.2550 1.00 -> 1.26 Inexact Rounded
  742. dqqua2104 quantize 1.2551 1.00 -> 1.26 Inexact Rounded
  743. dqqua2107 quantize 1.2560 1.00 -> 1.26 Inexact Rounded
  744. dqqua2108 quantize 1.2570 1.00 -> 1.26 Inexact Rounded
  745. dqqua2109 quantize 1.2599 1.00 -> 1.26 Inexact Rounded
  746. dqqua2111 quantize -1.2599 1.00 -> -1.26 Inexact Rounded
  747. dqqua2200 quantize 1.2600 1.00 -> 1.26 Rounded
  748. dqqua2201 quantize 1.2601 1.00 -> 1.26 Inexact Rounded
  749. dqqua2202 quantize 1.2610 1.00 -> 1.26 Inexact Rounded
  750. dqqua2203 quantize 1.2650 1.00 -> 1.26 Inexact Rounded
  751. dqqua2204 quantize 1.2651 1.00 -> 1.26 Inexact Rounded
  752. dqqua2207 quantize 1.2660 1.00 -> 1.26 Inexact Rounded
  753. dqqua2208 quantize 1.2670 1.00 -> 1.26 Inexact Rounded
  754. dqqua2209 quantize 1.2699 1.00 -> 1.26 Inexact Rounded
  755. dqqua2211 quantize -1.2699 1.00 -> -1.26 Inexact Rounded
  756. dqqua2300 quantize 1.2900 1.00 -> 1.29 Rounded
  757. dqqua2301 quantize 1.2901 1.00 -> 1.29 Inexact Rounded
  758. dqqua2302 quantize 1.2910 1.00 -> 1.29 Inexact Rounded
  759. dqqua2303 quantize 1.2950 1.00 -> 1.29 Inexact Rounded
  760. dqqua2304 quantize 1.2951 1.00 -> 1.29 Inexact Rounded
  761. dqqua2307 quantize 1.2960 1.00 -> 1.29 Inexact Rounded
  762. dqqua2308 quantize 1.2970 1.00 -> 1.29 Inexact Rounded
  763. dqqua2309 quantize 1.2999 1.00 -> 1.29 Inexact Rounded
  764. dqqua2311 quantize -1.2999 1.00 -> -1.29 Inexact Rounded
  765. -- Null tests
  766. dqqua998 quantize 10 # -> NaN Invalid_operation
  767. dqqua999 quantize # 1e10 -> NaN Invalid_operation