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