1------------------------------------------------------------------------
2-- ddQuantize.decTest -- decDouble 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'
26precision:   16
27maxExponent: 384
28minExponent: -383
29extended:    1
30clamp:       1
31rounding:    half_even
32
33-- sanity checks
34ddqua001 quantize 0       1e0   -> 0
35ddqua002 quantize 1       1e0   -> 1
36ddqua003 quantize 0.1    1e+2   -> 0E+2 Inexact Rounded
37ddqua005 quantize 0.1    1e+1   -> 0E+1 Inexact Rounded
38ddqua006 quantize 0.1     1e0   -> 0 Inexact Rounded
39ddqua007 quantize 0.1    1e-1   -> 0.1
40ddqua008 quantize 0.1    1e-2   -> 0.10
41ddqua009 quantize 0.1    1e-3   -> 0.100
42ddqua010 quantize 0.9    1e+2   -> 0E+2 Inexact Rounded
43ddqua011 quantize 0.9    1e+1   -> 0E+1 Inexact Rounded
44ddqua012 quantize 0.9    1e+0   -> 1 Inexact Rounded
45ddqua013 quantize 0.9    1e-1   -> 0.9
46ddqua014 quantize 0.9    1e-2   -> 0.90
47ddqua015 quantize 0.9    1e-3   -> 0.900
48-- negatives
49ddqua021 quantize -0      1e0   -> -0
50ddqua022 quantize -1      1e0   -> -1
51ddqua023 quantize -0.1   1e+2   -> -0E+2 Inexact Rounded
52ddqua025 quantize -0.1   1e+1   -> -0E+1 Inexact Rounded
53ddqua026 quantize -0.1    1e0   -> -0 Inexact Rounded
54ddqua027 quantize -0.1   1e-1   -> -0.1
55ddqua028 quantize -0.1   1e-2   -> -0.10
56ddqua029 quantize -0.1   1e-3   -> -0.100
57ddqua030 quantize -0.9   1e+2   -> -0E+2 Inexact Rounded
58ddqua031 quantize -0.9   1e+1   -> -0E+1 Inexact Rounded
59ddqua032 quantize -0.9   1e+0   -> -1 Inexact Rounded
60ddqua033 quantize -0.9   1e-1   -> -0.9
61ddqua034 quantize -0.9   1e-2   -> -0.90
62ddqua035 quantize -0.9   1e-3   -> -0.900
63ddqua036 quantize -0.5   1e+2   -> -0E+2 Inexact Rounded
64ddqua037 quantize -0.5   1e+1   -> -0E+1 Inexact Rounded
65ddqua038 quantize -0.5   1e+0   -> -0 Inexact Rounded
66ddqua039 quantize -0.5   1e-1   -> -0.5
67ddqua040 quantize -0.5   1e-2   -> -0.50
68ddqua041 quantize -0.5   1e-3   -> -0.500
69ddqua042 quantize -0.9   1e+2   -> -0E+2 Inexact Rounded
70ddqua043 quantize -0.9   1e+1   -> -0E+1 Inexact Rounded
71ddqua044 quantize -0.9   1e+0   -> -1 Inexact Rounded
72ddqua045 quantize -0.9   1e-1   -> -0.9
73ddqua046 quantize -0.9   1e-2   -> -0.90
74ddqua047 quantize -0.9   1e-3   -> -0.900
75
76-- examples from Specification
77ddqua060 quantize 2.17   0.001  -> 2.170
78ddqua061 quantize 2.17   0.01   -> 2.17
79ddqua062 quantize 2.17   0.1    -> 2.2 Inexact Rounded
80ddqua063 quantize 2.17   1e+0   -> 2 Inexact Rounded
81ddqua064 quantize 2.17   1e+1   -> 0E+1 Inexact Rounded
82ddqua065 quantize -Inf    Inf   -> -Infinity
83ddqua066 quantize 2       Inf   -> NaN Invalid_operation
84ddqua067 quantize -0.1    1     -> -0 Inexact Rounded
85ddqua068 quantize -0      1e+5     -> -0E+5
86ddqua069 quantize +123456789012345.6 1e-2 -> NaN Invalid_operation
87ddqua070 quantize -987654335236450.6 1e-2 -> NaN Invalid_operation
88ddqua071 quantize 217    1e-1   -> 217.0
89ddqua072 quantize 217    1e+0   -> 217
90ddqua073 quantize 217    1e+1   -> 2.2E+2 Inexact Rounded
91ddqua074 quantize 217    1e+2   -> 2E+2 Inexact Rounded
92
93-- general tests ..
94ddqua089 quantize 12     1e+4   -> 0E+4 Inexact Rounded
95ddqua090 quantize 12     1e+3   -> 0E+3 Inexact Rounded
96ddqua091 quantize 12     1e+2   -> 0E+2 Inexact Rounded
97ddqua092 quantize 12     1e+1   -> 1E+1 Inexact Rounded
98ddqua093 quantize 1.2345 1e-2   -> 1.23 Inexact Rounded
99ddqua094 quantize 1.2355 1e-2   -> 1.24 Inexact Rounded
100ddqua095 quantize 1.2345 1e-6   -> 1.234500
101ddqua096 quantize 9.9999 1e-2   -> 10.00 Inexact Rounded
102ddqua097 quantize 0.0001 1e-2   -> 0.00 Inexact Rounded
103ddqua098 quantize 0.001  1e-2   -> 0.00 Inexact Rounded
104ddqua099 quantize 0.009  1e-2   -> 0.01 Inexact Rounded
105ddqua100 quantize 92     1e+2   -> 1E+2 Inexact Rounded
106
107ddqua101 quantize -1      1e0   ->  -1
108ddqua102 quantize -1     1e-1   ->  -1.0
109ddqua103 quantize -1     1e-2   ->  -1.00
110ddqua104 quantize  0      1e0   ->  0
111ddqua105 quantize  0     1e-1   ->  0.0
112ddqua106 quantize  0     1e-2   ->  0.00
113ddqua107 quantize  0.00   1e0   ->  0
114ddqua108 quantize  0     1e+1   ->  0E+1
115ddqua109 quantize  0     1e+2   ->  0E+2
116ddqua110 quantize +1      1e0   ->  1
117ddqua111 quantize +1     1e-1   ->  1.0
118ddqua112 quantize +1     1e-2   ->  1.00
119
120ddqua120 quantize   1.04  1e-3 ->  1.040
121ddqua121 quantize   1.04  1e-2 ->  1.04
122ddqua122 quantize   1.04  1e-1 ->  1.0 Inexact Rounded
123ddqua123 quantize   1.04   1e0 ->  1 Inexact Rounded
124ddqua124 quantize   1.05  1e-3 ->  1.050
125ddqua125 quantize   1.05  1e-2 ->  1.05
126ddqua126 quantize   1.05  1e-1 ->  1.0 Inexact Rounded
127ddqua131 quantize   1.05   1e0 ->  1 Inexact Rounded
128ddqua132 quantize   1.06  1e-3 ->  1.060
129ddqua133 quantize   1.06  1e-2 ->  1.06
130ddqua134 quantize   1.06  1e-1 ->  1.1 Inexact Rounded
131ddqua135 quantize   1.06   1e0 ->  1 Inexact Rounded
132
133ddqua140 quantize   -10    1e-2  ->  -10.00
134ddqua141 quantize   +1     1e-2  ->  1.00
135ddqua142 quantize   +10    1e-2  ->  10.00
136ddqua143 quantize   1E+17  1e-2  ->  NaN Invalid_operation
137ddqua144 quantize   1E-17  1e-2  ->  0.00 Inexact Rounded
138ddqua145 quantize   1E-3   1e-2  ->  0.00 Inexact Rounded
139ddqua146 quantize   1E-2   1e-2  ->  0.01
140ddqua147 quantize   1E-1   1e-2  ->  0.10
141ddqua148 quantize   0E-17  1e-2  ->  0.00
142
143ddqua150 quantize   1.0600 1e-5 ->  1.06000
144ddqua151 quantize   1.0600 1e-4 ->  1.0600
145ddqua152 quantize   1.0600 1e-3 ->  1.060 Rounded
146ddqua153 quantize   1.0600 1e-2 ->  1.06 Rounded
147ddqua154 quantize   1.0600 1e-1 ->  1.1 Inexact Rounded
148ddqua155 quantize   1.0600  1e0 ->  1 Inexact Rounded
149
150-- a couple where rounding was different in base tests
151rounding:    half_up
152ddqua157 quantize -0.5   1e+0   -> -1 Inexact Rounded
153ddqua158 quantize   1.05  1e-1 ->  1.1 Inexact Rounded
154ddqua159 quantize   1.06   1e0 ->  1 Inexact Rounded
155rounding:    half_even
156
157-- base tests with non-1 coefficients
158ddqua161 quantize 0      -9e0   -> 0
159ddqua162 quantize 1      -7e0   -> 1
160ddqua163 quantize 0.1   -1e+2   -> 0E+2 Inexact Rounded
161ddqua165 quantize 0.1    0e+1   -> 0E+1 Inexact Rounded
162ddqua166 quantize 0.1     2e0   -> 0 Inexact Rounded
163ddqua167 quantize 0.1    3e-1   -> 0.1
164ddqua168 quantize 0.1   44e-2   -> 0.10
165ddqua169 quantize 0.1  555e-3   -> 0.100
166ddqua170 quantize 0.9 6666e+2   -> 0E+2 Inexact Rounded
167ddqua171 quantize 0.9 -777e+1   -> 0E+1 Inexact Rounded
168ddqua172 quantize 0.9  -88e+0   -> 1 Inexact Rounded
169ddqua173 quantize 0.9   -9e-1   -> 0.9
170ddqua174 quantize 0.9    0e-2   -> 0.90
171ddqua175 quantize 0.9  1.1e-3   -> 0.9000
172-- negatives
173ddqua181 quantize -0    1.1e0   -> -0.0
174ddqua182 quantize -1     -1e0   -> -1
175ddqua183 quantize -0.1  11e+2   -> -0E+2 Inexact Rounded
176ddqua185 quantize -0.1 111e+1   -> -0E+1 Inexact Rounded
177ddqua186 quantize -0.1   71e0   -> -0 Inexact Rounded
178ddqua187 quantize -0.1 -91e-1   -> -0.1
179ddqua188 quantize -0.1 -.1e-2   -> -0.100
180ddqua189 quantize -0.1  -1e-3   -> -0.100
181ddqua190 quantize -0.9   0e+2   -> -0E+2 Inexact Rounded
182ddqua191 quantize -0.9  -0e+1   -> -0E+1 Inexact Rounded
183ddqua192 quantize -0.9 -10e+0   -> -1 Inexact Rounded
184ddqua193 quantize -0.9 100e-1   -> -0.9
185ddqua194 quantize -0.9 999e-2   -> -0.90
186
187-- +ve exponents ..
188ddqua201 quantize   -1   1e+0 ->  -1
189ddqua202 quantize   -1   1e+1 ->  -0E+1 Inexact Rounded
190ddqua203 quantize   -1   1e+2 ->  -0E+2 Inexact Rounded
191ddqua204 quantize    0   1e+0 ->  0
192ddqua205 quantize    0   1e+1 ->  0E+1
193ddqua206 quantize    0   1e+2 ->  0E+2
194ddqua207 quantize   +1   1e+0 ->  1
195ddqua208 quantize   +1   1e+1 ->  0E+1 Inexact Rounded
196ddqua209 quantize   +1   1e+2 ->  0E+2 Inexact Rounded
197
198ddqua220 quantize   1.04 1e+3 ->  0E+3 Inexact Rounded
199ddqua221 quantize   1.04 1e+2 ->  0E+2 Inexact Rounded
200ddqua222 quantize   1.04 1e+1 ->  0E+1 Inexact Rounded
201ddqua223 quantize   1.04 1e+0 ->  1 Inexact Rounded
202ddqua224 quantize   1.05 1e+3 ->  0E+3 Inexact Rounded
203ddqua225 quantize   1.05 1e+2 ->  0E+2 Inexact Rounded
204ddqua226 quantize   1.05 1e+1 ->  0E+1 Inexact Rounded
205ddqua227 quantize   1.05 1e+0 ->  1 Inexact Rounded
206ddqua228 quantize   1.05 1e+3 ->  0E+3 Inexact Rounded
207ddqua229 quantize   1.05 1e+2 ->  0E+2 Inexact Rounded
208ddqua230 quantize   1.05 1e+1 ->  0E+1 Inexact Rounded
209ddqua231 quantize   1.05 1e+0 ->  1 Inexact Rounded
210ddqua232 quantize   1.06 1e+3 ->  0E+3 Inexact Rounded
211ddqua233 quantize   1.06 1e+2 ->  0E+2 Inexact Rounded
212ddqua234 quantize   1.06 1e+1 ->  0E+1 Inexact Rounded
213ddqua235 quantize   1.06 1e+0 ->  1 Inexact Rounded
214
215ddqua240 quantize   -10   1e+1  ->  -1E+1 Rounded
216ddqua241 quantize   +1    1e+1  ->  0E+1 Inexact Rounded
217ddqua242 quantize   +10   1e+1  ->  1E+1 Rounded
218ddqua243 quantize   1E+1  1e+1  ->  1E+1          -- underneath this is E+1
219ddqua244 quantize   1E+2  1e+1  ->  1.0E+2        -- underneath this is E+1
220ddqua245 quantize   1E+3  1e+1  ->  1.00E+3       -- underneath this is E+1
221ddqua246 quantize   1E+4  1e+1  ->  1.000E+4      -- underneath this is E+1
222ddqua247 quantize   1E+5  1e+1  ->  1.0000E+5     -- underneath this is E+1
223ddqua248 quantize   1E+6  1e+1  ->  1.00000E+6    -- underneath this is E+1
224ddqua249 quantize   1E+7  1e+1  ->  1.000000E+7   -- underneath this is E+1
225ddqua250 quantize   1E+8  1e+1  ->  1.0000000E+8  -- underneath this is E+1
226ddqua251 quantize   1E+9  1e+1  ->  1.00000000E+9 -- underneath this is E+1
227-- next one tries to add 9 zeros
228ddqua252 quantize   1E+17 1e+1  ->  NaN Invalid_operation
229ddqua253 quantize   1E-17 1e+1  ->  0E+1 Inexact Rounded
230ddqua254 quantize   1E-2  1e+1  ->  0E+1 Inexact Rounded
231ddqua255 quantize   0E-17 1e+1  ->  0E+1
232ddqua256 quantize  -0E-17 1e+1  -> -0E+1
233ddqua257 quantize  -0E-1  1e+1  -> -0E+1
234ddqua258 quantize  -0     1e+1  -> -0E+1
235ddqua259 quantize  -0E+1  1e+1  -> -0E+1
236
237ddqua260 quantize   -10   1e+2  ->  -0E+2 Inexact Rounded
238ddqua261 quantize   +1    1e+2  ->  0E+2 Inexact Rounded
239ddqua262 quantize   +10   1e+2  ->  0E+2 Inexact Rounded
240ddqua263 quantize   1E+1  1e+2  ->  0E+2 Inexact Rounded
241ddqua264 quantize   1E+2  1e+2  ->  1E+2
242ddqua265 quantize   1E+3  1e+2  ->  1.0E+3
243ddqua266 quantize   1E+4  1e+2  ->  1.00E+4
244ddqua267 quantize   1E+5  1e+2  ->  1.000E+5
245ddqua268 quantize   1E+6  1e+2  ->  1.0000E+6
246ddqua269 quantize   1E+7  1e+2  ->  1.00000E+7
247ddqua270 quantize   1E+8  1e+2  ->  1.000000E+8
248ddqua271 quantize   1E+9  1e+2  ->  1.0000000E+9
249ddqua272 quantize   1E+10 1e+2  ->  1.00000000E+10
250ddqua273 quantize   1E-10 1e+2  ->  0E+2 Inexact Rounded
251ddqua274 quantize   1E-2  1e+2  ->  0E+2 Inexact Rounded
252ddqua275 quantize   0E-10 1e+2  ->  0E+2
253
254ddqua280 quantize   -10   1e+3  ->  -0E+3 Inexact Rounded
255ddqua281 quantize   +1    1e+3  ->  0E+3 Inexact Rounded
256ddqua282 quantize   +10   1e+3  ->  0E+3 Inexact Rounded
257ddqua283 quantize   1E+1  1e+3  ->  0E+3 Inexact Rounded
258ddqua284 quantize   1E+2  1e+3  ->  0E+3 Inexact Rounded
259ddqua285 quantize   1E+3  1e+3  ->  1E+3
260ddqua286 quantize   1E+4  1e+3  ->  1.0E+4
261ddqua287 quantize   1E+5  1e+3  ->  1.00E+5
262ddqua288 quantize   1E+6  1e+3  ->  1.000E+6
263ddqua289 quantize   1E+7  1e+3  ->  1.0000E+7
264ddqua290 quantize   1E+8  1e+3  ->  1.00000E+8
265ddqua291 quantize   1E+9  1e+3  ->  1.000000E+9
266ddqua292 quantize   1E+10 1e+3  ->  1.0000000E+10
267ddqua293 quantize   1E-10 1e+3  ->  0E+3 Inexact Rounded
268ddqua294 quantize   1E-2  1e+3  ->  0E+3 Inexact Rounded
269ddqua295 quantize   0E-10 1e+3  ->  0E+3
270
271-- round up from below [sign wrong in JIT compiler once]
272ddqua300 quantize   0.0078 1e-5 ->  0.00780
273ddqua301 quantize   0.0078 1e-4 ->  0.0078
274ddqua302 quantize   0.0078 1e-3 ->  0.008 Inexact Rounded
275ddqua303 quantize   0.0078 1e-2 ->  0.01 Inexact Rounded
276ddqua304 quantize   0.0078 1e-1 ->  0.0 Inexact Rounded
277ddqua305 quantize   0.0078  1e0 ->  0 Inexact Rounded
278ddqua306 quantize   0.0078 1e+1 ->  0E+1 Inexact Rounded
279ddqua307 quantize   0.0078 1e+2 ->  0E+2 Inexact Rounded
280
281ddqua310 quantize  -0.0078 1e-5 -> -0.00780
282ddqua311 quantize  -0.0078 1e-4 -> -0.0078
283ddqua312 quantize  -0.0078 1e-3 -> -0.008 Inexact Rounded
284ddqua313 quantize  -0.0078 1e-2 -> -0.01 Inexact Rounded
285ddqua314 quantize  -0.0078 1e-1 -> -0.0 Inexact Rounded
286ddqua315 quantize  -0.0078  1e0 -> -0 Inexact Rounded
287ddqua316 quantize  -0.0078 1e+1 -> -0E+1 Inexact Rounded
288ddqua317 quantize  -0.0078 1e+2 -> -0E+2 Inexact Rounded
289
290ddqua320 quantize   0.078 1e-5 ->  0.07800
291ddqua321 quantize   0.078 1e-4 ->  0.0780
292ddqua322 quantize   0.078 1e-3 ->  0.078
293ddqua323 quantize   0.078 1e-2 ->  0.08 Inexact Rounded
294ddqua324 quantize   0.078 1e-1 ->  0.1 Inexact Rounded
295ddqua325 quantize   0.078  1e0 ->  0 Inexact Rounded
296ddqua326 quantize   0.078 1e+1 ->  0E+1 Inexact Rounded
297ddqua327 quantize   0.078 1e+2 ->  0E+2 Inexact Rounded
298
299ddqua330 quantize  -0.078 1e-5 -> -0.07800
300ddqua331 quantize  -0.078 1e-4 -> -0.0780
301ddqua332 quantize  -0.078 1e-3 -> -0.078
302ddqua333 quantize  -0.078 1e-2 -> -0.08 Inexact Rounded
303ddqua334 quantize  -0.078 1e-1 -> -0.1 Inexact Rounded
304ddqua335 quantize  -0.078  1e0 -> -0 Inexact Rounded
305ddqua336 quantize  -0.078 1e+1 -> -0E+1 Inexact Rounded
306ddqua337 quantize  -0.078 1e+2 -> -0E+2 Inexact Rounded
307
308ddqua340 quantize   0.78 1e-5 ->  0.78000
309ddqua341 quantize   0.78 1e-4 ->  0.7800
310ddqua342 quantize   0.78 1e-3 ->  0.780
311ddqua343 quantize   0.78 1e-2 ->  0.78
312ddqua344 quantize   0.78 1e-1 ->  0.8 Inexact Rounded
313ddqua345 quantize   0.78  1e0 ->  1 Inexact Rounded
314ddqua346 quantize   0.78 1e+1 ->  0E+1 Inexact Rounded
315ddqua347 quantize   0.78 1e+2 ->  0E+2 Inexact Rounded
316
317ddqua350 quantize  -0.78 1e-5 -> -0.78000
318ddqua351 quantize  -0.78 1e-4 -> -0.7800
319ddqua352 quantize  -0.78 1e-3 -> -0.780
320ddqua353 quantize  -0.78 1e-2 -> -0.78
321ddqua354 quantize  -0.78 1e-1 -> -0.8 Inexact Rounded
322ddqua355 quantize  -0.78  1e0 -> -1 Inexact Rounded
323ddqua356 quantize  -0.78 1e+1 -> -0E+1 Inexact Rounded
324ddqua357 quantize  -0.78 1e+2 -> -0E+2 Inexact Rounded
325
326ddqua360 quantize   7.8 1e-5 ->  7.80000
327ddqua361 quantize   7.8 1e-4 ->  7.8000
328ddqua362 quantize   7.8 1e-3 ->  7.800
329ddqua363 quantize   7.8 1e-2 ->  7.80
330ddqua364 quantize   7.8 1e-1 ->  7.8
331ddqua365 quantize   7.8  1e0 ->  8 Inexact Rounded
332ddqua366 quantize   7.8 1e+1 ->  1E+1 Inexact Rounded
333ddqua367 quantize   7.8 1e+2 ->  0E+2 Inexact Rounded
334ddqua368 quantize   7.8 1e+3 ->  0E+3 Inexact Rounded
335
336ddqua370 quantize  -7.8 1e-5 -> -7.80000
337ddqua371 quantize  -7.8 1e-4 -> -7.8000
338ddqua372 quantize  -7.8 1e-3 -> -7.800
339ddqua373 quantize  -7.8 1e-2 -> -7.80
340ddqua374 quantize  -7.8 1e-1 -> -7.8
341ddqua375 quantize  -7.8  1e0 -> -8 Inexact Rounded
342ddqua376 quantize  -7.8 1e+1 -> -1E+1 Inexact Rounded
343ddqua377 quantize  -7.8 1e+2 -> -0E+2 Inexact Rounded
344ddqua378 quantize  -7.8 1e+3 -> -0E+3 Inexact Rounded
345
346-- some individuals
347ddqua380 quantize   1234567352364.506 1e-2 -> 1234567352364.51 Inexact Rounded
348ddqua381 quantize   12345673523645.06 1e-2 -> 12345673523645.06
349ddqua382 quantize   123456735236450.6 1e-2 -> NaN Invalid_operation
350ddqua383 quantize   1234567352364506  1e-2 -> NaN Invalid_operation
351ddqua384 quantize  -1234567352364.506 1e-2 -> -1234567352364.51 Inexact Rounded
352ddqua385 quantize  -12345673523645.06 1e-2 -> -12345673523645.06
353ddqua386 quantize  -123456735236450.6 1e-2 -> NaN Invalid_operation
354ddqua387 quantize  -1234567352364506  1e-2 -> NaN Invalid_operation
355
356rounding: down
357ddqua389 quantize   123456735236450.6 1e-2 -> NaN Invalid_operation
358-- ? should that one instead have been:
359-- ddqua389 quantize   123456735236450.6 1e-2 -> NaN Invalid_operation
360rounding: half_up
361
362-- and a few more from e-mail discussions
363ddqua391 quantize  12345678912.34567  1e-3 -> 12345678912.346   Inexact Rounded
364ddqua392 quantize  123456789123.4567  1e-3 -> 123456789123.457  Inexact Rounded
365ddqua393 quantize  1234567891234.567  1e-3 -> 1234567891234.567
366ddqua394 quantize  12345678912345.67  1e-3 -> NaN Invalid_operation
367ddqua395 quantize  123456789123456.7  1e-3 -> NaN Invalid_operation
368ddqua396 quantize  1234567891234567.  1e-3 -> NaN Invalid_operation
369
370-- some 9999 round-up cases
371ddqua400 quantize   9.999        1e-5  ->  9.99900
372ddqua401 quantize   9.999        1e-4  ->  9.9990
373ddqua402 quantize   9.999        1e-3  ->  9.999
374ddqua403 quantize   9.999        1e-2  -> 10.00     Inexact Rounded
375ddqua404 quantize   9.999        1e-1  -> 10.0      Inexact Rounded
376ddqua405 quantize   9.999         1e0  -> 10        Inexact Rounded
377ddqua406 quantize   9.999         1e1  -> 1E+1      Inexact Rounded
378ddqua407 quantize   9.999         1e2  -> 0E+2      Inexact Rounded
379
380ddqua410 quantize   0.999        1e-5  ->  0.99900
381ddqua411 quantize   0.999        1e-4  ->  0.9990
382ddqua412 quantize   0.999        1e-3  ->  0.999
383ddqua413 quantize   0.999        1e-2  ->  1.00     Inexact Rounded
384ddqua414 quantize   0.999        1e-1  ->  1.0      Inexact Rounded
385ddqua415 quantize   0.999         1e0  ->  1        Inexact Rounded
386ddqua416 quantize   0.999         1e1  -> 0E+1      Inexact Rounded
387
388ddqua420 quantize   0.0999       1e-5  ->  0.09990
389ddqua421 quantize   0.0999       1e-4  ->  0.0999
390ddqua422 quantize   0.0999       1e-3  ->  0.100    Inexact Rounded
391ddqua423 quantize   0.0999       1e-2  ->  0.10     Inexact Rounded
392ddqua424 quantize   0.0999       1e-1  ->  0.1      Inexact Rounded
393ddqua425 quantize   0.0999        1e0  ->  0        Inexact Rounded
394ddqua426 quantize   0.0999        1e1  -> 0E+1      Inexact Rounded
395
396ddqua430 quantize   0.00999      1e-5  ->  0.00999
397ddqua431 quantize   0.00999      1e-4  ->  0.0100   Inexact Rounded
398ddqua432 quantize   0.00999      1e-3  ->  0.010    Inexact Rounded
399ddqua433 quantize   0.00999      1e-2  ->  0.01     Inexact Rounded
400ddqua434 quantize   0.00999      1e-1  ->  0.0      Inexact Rounded
401ddqua435 quantize   0.00999       1e0  ->  0        Inexact Rounded
402ddqua436 quantize   0.00999       1e1  -> 0E+1      Inexact Rounded
403
404ddqua440 quantize   0.000999     1e-5  ->  0.00100  Inexact Rounded
405ddqua441 quantize   0.000999     1e-4  ->  0.0010   Inexact Rounded
406ddqua442 quantize   0.000999     1e-3  ->  0.001    Inexact Rounded
407ddqua443 quantize   0.000999     1e-2  ->  0.00     Inexact Rounded
408ddqua444 quantize   0.000999     1e-1  ->  0.0      Inexact Rounded
409ddqua445 quantize   0.000999      1e0  ->  0        Inexact Rounded
410ddqua446 quantize   0.000999      1e1  -> 0E+1      Inexact Rounded
411
412ddqua1001 quantize  0.000        0.001 ->  0.000
413ddqua1002 quantize  0.001        0.001 ->  0.001
414ddqua1003 quantize  0.0012       0.001 ->  0.001     Inexact Rounded
415ddqua1004 quantize  0.0018       0.001 ->  0.002     Inexact Rounded
416ddqua1005 quantize  0.501        0.001 ->  0.501
417ddqua1006 quantize  0.5012       0.001 ->  0.501     Inexact Rounded
418ddqua1007 quantize  0.5018       0.001 ->  0.502     Inexact Rounded
419ddqua1008 quantize  0.999        0.001 ->  0.999
420
421ddqua481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
422ddqua482 quantize 1234567800  1e+1 -> 1.23456780E+9 Rounded
423ddqua483 quantize 1234567890  1e+1 -> 1.23456789E+9 Rounded
424ddqua484 quantize 1234567891  1e+1 -> 1.23456789E+9 Inexact Rounded
425ddqua485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
426ddqua486 quantize 1234567896  1e+1 -> 1.23456790E+9 Inexact Rounded
427-- a potential double-round
428ddqua487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
429ddqua488 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
430
431ddqua491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
432ddqua492 quantize 1234567800  1e+1 -> 1.23456780E+9 Rounded
433ddqua493 quantize 1234567890  1e+1 -> 1.23456789E+9 Rounded
434ddqua494 quantize 1234567891  1e+1 -> 1.23456789E+9 Inexact Rounded
435ddqua495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
436ddqua496 quantize 1234567896  1e+1 -> 1.23456790E+9 Inexact Rounded
437ddqua497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
438ddqua498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
439
440-- Zeros
441ddqua500 quantize   0     1e1 ->  0E+1
442ddqua501 quantize   0     1e0 ->  0
443ddqua502 quantize   0    1e-1 ->  0.0
444ddqua503 quantize   0.0  1e-1 ->  0.0
445ddqua504 quantize   0.0   1e0 ->  0
446ddqua505 quantize   0.0  1e+1 ->  0E+1
447ddqua506 quantize   0E+1 1e-1 ->  0.0
448ddqua507 quantize   0E+1  1e0 ->  0
449ddqua508 quantize   0E+1 1e+1 ->  0E+1
450ddqua509 quantize  -0     1e1 -> -0E+1
451ddqua510 quantize  -0     1e0 -> -0
452ddqua511 quantize  -0    1e-1 -> -0.0
453ddqua512 quantize  -0.0  1e-1 -> -0.0
454ddqua513 quantize  -0.0   1e0 -> -0
455ddqua514 quantize  -0.0  1e+1 -> -0E+1
456ddqua515 quantize  -0E+1 1e-1 -> -0.0
457ddqua516 quantize  -0E+1  1e0 -> -0
458ddqua517 quantize  -0E+1 1e+1 -> -0E+1
459
460-- Suspicious RHS values
461ddqua520 quantize   1.234    1e359 -> 0E+359 Inexact Rounded
462ddqua521 quantize 123.456    1e359 -> 0E+359 Inexact Rounded
463ddqua522 quantize   1.234    1e359 -> 0E+359 Inexact Rounded
464ddqua523 quantize 123.456    1e359 -> 0E+359 Inexact Rounded
465-- next four are "won't fit" overfl
466ddqua526 quantize   1.234   1e-299 -> NaN Invalid_operation
467ddqua527 quantize 123.456   1e-299 -> NaN Invalid_operation
468ddqua528 quantize   1.234   1e-299 -> NaN Invalid_operation
469ddqua529 quantize 123.456   1e-299 -> NaN Invalid_operation
470
471ddqua532 quantize   1.234E+299    1e299 -> 1E+299    Inexact Rounded
472ddqua533 quantize   1.234E+298    1e299 -> 0E+299    Inexact Rounded
473ddqua534 quantize   1.234         1e299 -> 0E+299    Inexact Rounded
474ddqua537 quantize   0            1e-299 -> 0E-299
475-- next two are "won't fit" overflows
476ddqua538 quantize   1.234        1e-299 -> NaN Invalid_operation
477ddqua539 quantize   1.234        1e-300 -> NaN Invalid_operation
478-- [more below]
479
480-- Specials
481ddqua580 quantize  Inf    -Inf   ->  Infinity
482ddqua581 quantize  Inf  1e-299   ->  NaN  Invalid_operation
483ddqua582 quantize  Inf  1e-1     ->  NaN  Invalid_operation
484ddqua583 quantize  Inf   1e0     ->  NaN  Invalid_operation
485ddqua584 quantize  Inf   1e1     ->  NaN  Invalid_operation
486ddqua585 quantize  Inf   1e299   ->  NaN  Invalid_operation
487ddqua586 quantize  Inf     Inf   ->  Infinity
488ddqua587 quantize -1000    Inf   ->  NaN  Invalid_operation
489ddqua588 quantize -Inf     Inf   ->  -Infinity
490ddqua589 quantize -1       Inf   ->  NaN  Invalid_operation
491ddqua590 quantize  0       Inf   ->  NaN  Invalid_operation
492ddqua591 quantize  1       Inf   ->  NaN  Invalid_operation
493ddqua592 quantize  1000    Inf   ->  NaN  Invalid_operation
494ddqua593 quantize  Inf     Inf   ->  Infinity
495ddqua594 quantize  Inf  1e-0     ->  NaN  Invalid_operation
496ddqua595 quantize -0       Inf   ->  NaN  Invalid_operation
497
498ddqua600 quantize -Inf    -Inf   ->  -Infinity
499ddqua601 quantize -Inf  1e-299   ->  NaN  Invalid_operation
500ddqua602 quantize -Inf  1e-1     ->  NaN  Invalid_operation
501ddqua603 quantize -Inf   1e0     ->  NaN  Invalid_operation
502ddqua604 quantize -Inf   1e1     ->  NaN  Invalid_operation
503ddqua605 quantize -Inf   1e299   ->  NaN  Invalid_operation
504ddqua606 quantize -Inf     Inf   ->  -Infinity
505ddqua607 quantize -1000    Inf   ->  NaN  Invalid_operation
506ddqua608 quantize -Inf    -Inf   ->  -Infinity
507ddqua609 quantize -1      -Inf   ->  NaN  Invalid_operation
508ddqua610 quantize  0      -Inf   ->  NaN  Invalid_operation
509ddqua611 quantize  1      -Inf   ->  NaN  Invalid_operation
510ddqua612 quantize  1000   -Inf   ->  NaN  Invalid_operation
511ddqua613 quantize  Inf    -Inf   ->  Infinity
512ddqua614 quantize -Inf  1e-0     ->  NaN  Invalid_operation
513ddqua615 quantize -0      -Inf   ->  NaN  Invalid_operation
514
515ddqua621 quantize  NaN   -Inf    ->  NaN
516ddqua622 quantize  NaN 1e-299    ->  NaN
517ddqua623 quantize  NaN 1e-1      ->  NaN
518ddqua624 quantize  NaN  1e0      ->  NaN
519ddqua625 quantize  NaN  1e1      ->  NaN
520ddqua626 quantize  NaN  1e299    ->  NaN
521ddqua627 quantize  NaN    Inf    ->  NaN
522ddqua628 quantize  NaN    NaN    ->  NaN
523ddqua629 quantize -Inf    NaN    ->  NaN
524ddqua630 quantize -1000   NaN    ->  NaN
525ddqua631 quantize -1      NaN    ->  NaN
526ddqua632 quantize  0      NaN    ->  NaN
527ddqua633 quantize  1      NaN    ->  NaN
528ddqua634 quantize  1000   NaN    ->  NaN
529ddqua635 quantize  Inf    NaN    ->  NaN
530ddqua636 quantize  NaN 1e-0      ->  NaN
531ddqua637 quantize -0      NaN    ->  NaN
532
533ddqua641 quantize  sNaN   -Inf   ->  NaN  Invalid_operation
534ddqua642 quantize  sNaN 1e-299   ->  NaN  Invalid_operation
535ddqua643 quantize  sNaN 1e-1     ->  NaN  Invalid_operation
536ddqua644 quantize  sNaN  1e0     ->  NaN  Invalid_operation
537ddqua645 quantize  sNaN  1e1     ->  NaN  Invalid_operation
538ddqua646 quantize  sNaN  1e299   ->  NaN  Invalid_operation
539ddqua647 quantize  sNaN    NaN   ->  NaN  Invalid_operation
540ddqua648 quantize  sNaN   sNaN   ->  NaN  Invalid_operation
541ddqua649 quantize  NaN    sNaN   ->  NaN  Invalid_operation
542ddqua650 quantize -Inf    sNaN   ->  NaN  Invalid_operation
543ddqua651 quantize -1000   sNaN   ->  NaN  Invalid_operation
544ddqua652 quantize -1      sNaN   ->  NaN  Invalid_operation
545ddqua653 quantize  0      sNaN   ->  NaN  Invalid_operation
546ddqua654 quantize  1      sNaN   ->  NaN  Invalid_operation
547ddqua655 quantize  1000   sNaN   ->  NaN  Invalid_operation
548ddqua656 quantize  Inf    sNaN   ->  NaN  Invalid_operation
549ddqua657 quantize  NaN    sNaN   ->  NaN  Invalid_operation
550ddqua658 quantize  sNaN 1e-0     ->  NaN  Invalid_operation
551ddqua659 quantize -0      sNaN   ->  NaN  Invalid_operation
552
553-- propagating NaNs
554ddqua661 quantize  NaN9 -Inf   ->  NaN9
555ddqua662 quantize  NaN8  919   ->  NaN8
556ddqua663 quantize  NaN71 Inf   ->  NaN71
557ddqua664 quantize  NaN6  NaN5  ->  NaN6
558ddqua665 quantize -Inf   NaN4  ->  NaN4
559ddqua666 quantize -919   NaN31 ->  NaN31
560ddqua667 quantize  Inf   NaN2  ->  NaN2
561
562ddqua671 quantize  sNaN99 -Inf    ->  NaN99 Invalid_operation
563ddqua672 quantize  sNaN98 -11     ->  NaN98 Invalid_operation
564ddqua673 quantize  sNaN97  NaN    ->  NaN97 Invalid_operation
565ddqua674 quantize  sNaN16 sNaN94  ->  NaN16 Invalid_operation
566ddqua675 quantize  NaN95  sNaN93  ->  NaN93 Invalid_operation
567ddqua676 quantize -Inf    sNaN92  ->  NaN92 Invalid_operation
568ddqua677 quantize  088    sNaN91  ->  NaN91 Invalid_operation
569ddqua678 quantize  Inf    sNaN90  ->  NaN90 Invalid_operation
570ddqua679 quantize  NaN    sNaN88  ->  NaN88 Invalid_operation
571
572ddqua681 quantize -NaN9 -Inf   -> -NaN9
573ddqua682 quantize -NaN8  919   -> -NaN8
574ddqua683 quantize -NaN71 Inf   -> -NaN71
575ddqua684 quantize -NaN6 -NaN5  -> -NaN6
576ddqua685 quantize -Inf  -NaN4  -> -NaN4
577ddqua686 quantize -919  -NaN31 -> -NaN31
578ddqua687 quantize  Inf  -NaN2  -> -NaN2
579
580ddqua691 quantize -sNaN99 -Inf    -> -NaN99 Invalid_operation
581ddqua692 quantize -sNaN98 -11     -> -NaN98 Invalid_operation
582ddqua693 quantize -sNaN97  NaN    -> -NaN97 Invalid_operation
583ddqua694 quantize -sNaN16 sNaN94  -> -NaN16 Invalid_operation
584ddqua695 quantize -NaN95 -sNaN93  -> -NaN93 Invalid_operation
585ddqua696 quantize -Inf   -sNaN92  -> -NaN92 Invalid_operation
586ddqua697 quantize  088   -sNaN91  -> -NaN91 Invalid_operation
587ddqua698 quantize  Inf   -sNaN90  -> -NaN90 Invalid_operation
588ddqua699 quantize  NaN   -sNaN88  -> -NaN88 Invalid_operation
589
590-- subnormals and underflow
591ddqua710 quantize  1.00E-383    1e-383  ->   1E-383    Rounded
592ddqua711 quantize  0.1E-383    2e-384  ->   1E-384   Subnormal
593ddqua712 quantize  0.10E-383   3e-384  ->   1E-384   Subnormal Rounded
594ddqua713 quantize  0.100E-383  4e-384  ->   1E-384   Subnormal Rounded
595ddqua714 quantize  0.01E-383   5e-385  ->   1E-385   Subnormal
596-- next is rounded to Emin
597ddqua715 quantize  0.999E-383   1e-383  ->   1E-383    Inexact Rounded
598ddqua716 quantize  0.099E-383 10e-384  ->   1E-384   Inexact Rounded Subnormal
599
600ddqua717 quantize  0.009E-383  1e-385  ->   1E-385   Inexact Rounded Subnormal
601ddqua718 quantize  0.001E-383  1e-385  ->   0E-385   Inexact Rounded
602ddqua719 quantize  0.0009E-383 1e-385  ->   0E-385   Inexact Rounded
603ddqua720 quantize  0.0001E-383 1e-385  ->   0E-385   Inexact Rounded
604
605ddqua730 quantize -1.00E-383   1e-383  ->  -1E-383     Rounded
606ddqua731 quantize -0.1E-383    1e-383  ->  -0E-383     Rounded Inexact
607ddqua732 quantize -0.10E-383   1e-383  ->  -0E-383     Rounded Inexact
608ddqua733 quantize -0.100E-383  1e-383  ->  -0E-383     Rounded Inexact
609ddqua734 quantize -0.01E-383   1e-383  ->  -0E-383     Inexact Rounded
610-- next is rounded to Emin
611ddqua735 quantize -0.999E-383 90e-383  ->  -1E-383     Inexact Rounded
612ddqua736 quantize -0.099E-383 -1e-383  ->  -0E-383     Inexact Rounded
613ddqua737 quantize -0.009E-383 -1e-383  ->  -0E-383     Inexact Rounded
614ddqua738 quantize -0.001E-383 -0e-383  ->  -0E-383     Inexact Rounded
615ddqua739 quantize -0.0001E-383 0e-383  ->  -0E-383     Inexact Rounded
616
617ddqua740 quantize -1.00E-383   1e-384 ->  -1.0E-383   Rounded
618ddqua741 quantize -0.1E-383    1e-384 ->  -1E-384    Subnormal
619ddqua742 quantize -0.10E-383   1e-384 ->  -1E-384    Subnormal Rounded
620ddqua743 quantize -0.100E-383  1e-384 ->  -1E-384    Subnormal Rounded
621ddqua744 quantize -0.01E-383   1e-384 ->  -0E-384    Inexact Rounded
622-- next is rounded to Emin
623ddqua745 quantize -0.999E-383  1e-384 ->  -1.0E-383   Inexact Rounded
624ddqua746 quantize -0.099E-383  1e-384 ->  -1E-384    Inexact Rounded Subnormal
625ddqua747 quantize -0.009E-383  1e-384 ->  -0E-384    Inexact Rounded
626ddqua748 quantize -0.001E-383  1e-384 ->  -0E-384    Inexact Rounded
627ddqua749 quantize -0.0001E-383 1e-384 ->  -0E-384    Inexact Rounded
628
629ddqua750 quantize -1.00E-383   1e-385 ->  -1.00E-383
630ddqua751 quantize -0.1E-383    1e-385 ->  -1.0E-384  Subnormal
631ddqua752 quantize -0.10E-383   1e-385 ->  -1.0E-384  Subnormal
632ddqua753 quantize -0.100E-383  1e-385 ->  -1.0E-384  Subnormal Rounded
633ddqua754 quantize -0.01E-383   1e-385 ->  -1E-385    Subnormal
634-- next is rounded to Emin
635ddqua755 quantize -0.999E-383  1e-385 ->  -1.00E-383  Inexact Rounded
636ddqua756 quantize -0.099E-383  1e-385 ->  -1.0E-384  Inexact Rounded Subnormal
637ddqua757 quantize -0.009E-383  1e-385 ->  -1E-385    Inexact Rounded Subnormal
638ddqua758 quantize -0.001E-383  1e-385 ->  -0E-385    Inexact Rounded
639ddqua759 quantize -0.0001E-383 1e-385 ->  -0E-385    Inexact Rounded
640
641ddqua760 quantize -1.00E-383   1e-386 ->  -1.000E-383
642ddqua761 quantize -0.1E-383    1e-386 ->  -1.00E-384  Subnormal
643ddqua762 quantize -0.10E-383   1e-386 ->  -1.00E-384  Subnormal
644ddqua763 quantize -0.100E-383  1e-386 ->  -1.00E-384  Subnormal
645ddqua764 quantize -0.01E-383   1e-386 ->  -1.0E-385   Subnormal
646ddqua765 quantize -0.999E-383  1e-386 ->  -9.99E-384  Subnormal
647ddqua766 quantize -0.099E-383  1e-386 ->  -9.9E-385   Subnormal
648ddqua767 quantize -0.009E-383  1e-386 ->  -9E-386     Subnormal
649ddqua768 quantize -0.001E-383  1e-386 ->  -1E-386     Subnormal
650ddqua769 quantize -0.0001E-383 1e-386 ->  -0E-386     Inexact Rounded
651
652-- More from Fung Lee
653ddqua1021 quantize  8.666666666666000E+384  1.000000000000000E+384 ->  8.666666666666000E+384
654ddqua1022 quantize -8.666666666666000E+384  1.000000000000000E+384 -> -8.666666666666000E+384
655ddqua1027 quantize 8.666666666666000E+323  1E+31    -> NaN Invalid_operation
656ddqua1029 quantize 8.66666666E+3           1E+3     -> 9E+3 Inexact Rounded
657
658
659--ddqua1030 quantize 8.666666666666000E+384 1E+384   -> 9.000000000000000E+384 Rounded Inexact
660--ddqua1031 quantize 8.666666666666000E+384 1E+384   -> 8.666666666666000E+384 Rounded
661--ddqua1032 quantize 8.666666666666000E+384 1E+383   -> 8.666666666666000E+384 Rounded
662--ddqua1033 quantize 8.666666666666000E+384 1E+382   -> 8.666666666666000E+384 Rounded
663--ddqua1034 quantize 8.666666666666000E+384 1E+381   -> 8.666666666666000E+384 Rounded
664--ddqua1035 quantize 8.666666666666000E+384 1E+380   -> 8.666666666666000E+384 Rounded
665
666-- Int and uInt32 edge values for testing conversions
667ddqua1040 quantize -2147483646     0 -> -2147483646
668ddqua1041 quantize -2147483647     0 -> -2147483647
669ddqua1042 quantize -2147483648     0 -> -2147483648
670ddqua1043 quantize -2147483649     0 -> -2147483649
671ddqua1044 quantize  2147483646     0 ->  2147483646
672ddqua1045 quantize  2147483647     0 ->  2147483647
673ddqua1046 quantize  2147483648     0 ->  2147483648
674ddqua1047 quantize  2147483649     0 ->  2147483649
675ddqua1048 quantize  4294967294     0 ->  4294967294
676ddqua1049 quantize  4294967295     0 ->  4294967295
677ddqua1050 quantize  4294967296     0 ->  4294967296
678ddqua1051 quantize  4294967297     0 ->  4294967297
679
680-- Rounding swathe
681rounding: half_even
682ddqua1100 quantize  1.2300    1.00    ->  1.23  Rounded
683ddqua1101 quantize  1.2301    1.00    ->  1.23  Inexact Rounded
684ddqua1102 quantize  1.2310    1.00    ->  1.23  Inexact Rounded
685ddqua1103 quantize  1.2350    1.00    ->  1.24  Inexact Rounded
686ddqua1104 quantize  1.2351    1.00    ->  1.24  Inexact Rounded
687ddqua1105 quantize  1.2450    1.00    ->  1.24  Inexact Rounded
688ddqua1106 quantize  1.2451    1.00    ->  1.25  Inexact Rounded
689ddqua1107 quantize  1.2360    1.00    ->  1.24  Inexact Rounded
690ddqua1108 quantize  1.2370    1.00    ->  1.24  Inexact Rounded
691ddqua1109 quantize  1.2399    1.00    ->  1.24  Inexact Rounded
692
693rounding: half_up
694ddqua1200 quantize  1.2300    1.00    ->  1.23  Rounded
695ddqua1201 quantize  1.2301    1.00    ->  1.23  Inexact Rounded
696ddqua1202 quantize  1.2310    1.00    ->  1.23  Inexact Rounded
697ddqua1203 quantize  1.2350    1.00    ->  1.24  Inexact Rounded
698ddqua1204 quantize  1.2351    1.00    ->  1.24  Inexact Rounded
699ddqua1205 quantize  1.2450    1.00    ->  1.25  Inexact Rounded
700ddqua1206 quantize  1.2451    1.00    ->  1.25  Inexact Rounded
701ddqua1207 quantize  1.2360    1.00    ->  1.24  Inexact Rounded
702ddqua1208 quantize  1.2370    1.00    ->  1.24  Inexact Rounded
703ddqua1209 quantize  1.2399    1.00    ->  1.24  Inexact Rounded
704
705rounding: half_down
706ddqua1300 quantize  1.2300    1.00    ->  1.23  Rounded
707ddqua1301 quantize  1.2301    1.00    ->  1.23  Inexact Rounded
708ddqua1302 quantize  1.2310    1.00    ->  1.23  Inexact Rounded
709ddqua1303 quantize  1.2350    1.00    ->  1.23  Inexact Rounded
710ddqua1304 quantize  1.2351    1.00    ->  1.24  Inexact Rounded
711ddqua1305 quantize  1.2450    1.00    ->  1.24  Inexact Rounded
712ddqua1306 quantize  1.2451    1.00    ->  1.25  Inexact Rounded
713ddqua1307 quantize  1.2360    1.00    ->  1.24  Inexact Rounded
714ddqua1308 quantize  1.2370    1.00    ->  1.24  Inexact Rounded
715ddqua1309 quantize  1.2399    1.00    ->  1.24  Inexact Rounded
716
717rounding: up
718ddqua1400 quantize  1.2300    1.00    ->  1.23  Rounded
719ddqua1401 quantize  1.2301    1.00    ->  1.24  Inexact Rounded
720ddqua1402 quantize  1.2310    1.00    ->  1.24  Inexact Rounded
721ddqua1403 quantize  1.2350    1.00    ->  1.24  Inexact Rounded
722ddqua1404 quantize  1.2351    1.00    ->  1.24  Inexact Rounded
723ddqua1405 quantize  1.2450    1.00    ->  1.25  Inexact Rounded
724ddqua1406 quantize  1.2451    1.00    ->  1.25  Inexact Rounded
725ddqua1407 quantize  1.2360    1.00    ->  1.24  Inexact Rounded
726ddqua1408 quantize  1.2370    1.00    ->  1.24  Inexact Rounded
727ddqua1409 quantize  1.2399    1.00    ->  1.24  Inexact Rounded
728ddqua1411 quantize -1.2399    1.00    -> -1.24  Inexact Rounded
729
730rounding: down
731ddqua1500 quantize  1.2300    1.00    ->  1.23  Rounded
732ddqua1501 quantize  1.2301    1.00    ->  1.23  Inexact Rounded
733ddqua1502 quantize  1.2310    1.00    ->  1.23  Inexact Rounded
734ddqua1503 quantize  1.2350    1.00    ->  1.23  Inexact Rounded
735ddqua1504 quantize  1.2351    1.00    ->  1.23  Inexact Rounded
736ddqua1505 quantize  1.2450    1.00    ->  1.24  Inexact Rounded
737ddqua1506 quantize  1.2451    1.00    ->  1.24  Inexact Rounded
738ddqua1507 quantize  1.2360    1.00    ->  1.23  Inexact Rounded
739ddqua1508 quantize  1.2370    1.00    ->  1.23  Inexact Rounded
740ddqua1509 quantize  1.2399    1.00    ->  1.23  Inexact Rounded
741ddqua1511 quantize -1.2399    1.00    -> -1.23  Inexact Rounded
742
743rounding: ceiling
744ddqua1600 quantize  1.2300    1.00    ->  1.23  Rounded
745ddqua1601 quantize  1.2301    1.00    ->  1.24  Inexact Rounded
746ddqua1602 quantize  1.2310    1.00    ->  1.24  Inexact Rounded
747ddqua1603 quantize  1.2350    1.00    ->  1.24  Inexact Rounded
748ddqua1604 quantize  1.2351    1.00    ->  1.24  Inexact Rounded
749ddqua1605 quantize  1.2450    1.00    ->  1.25  Inexact Rounded
750ddqua1606 quantize  1.2451    1.00    ->  1.25  Inexact Rounded
751ddqua1607 quantize  1.2360    1.00    ->  1.24  Inexact Rounded
752ddqua1608 quantize  1.2370    1.00    ->  1.24  Inexact Rounded
753ddqua1609 quantize  1.2399    1.00    ->  1.24  Inexact Rounded
754ddqua1611 quantize -1.2399    1.00    -> -1.23  Inexact Rounded
755
756rounding: floor
757ddqua1700 quantize  1.2300    1.00    ->  1.23  Rounded
758ddqua1701 quantize  1.2301    1.00    ->  1.23  Inexact Rounded
759ddqua1702 quantize  1.2310    1.00    ->  1.23  Inexact Rounded
760ddqua1703 quantize  1.2350    1.00    ->  1.23  Inexact Rounded
761ddqua1704 quantize  1.2351    1.00    ->  1.23  Inexact Rounded
762ddqua1705 quantize  1.2450    1.00    ->  1.24  Inexact Rounded
763ddqua1706 quantize  1.2451    1.00    ->  1.24  Inexact Rounded
764ddqua1707 quantize  1.2360    1.00    ->  1.23  Inexact Rounded
765ddqua1708 quantize  1.2370    1.00    ->  1.23  Inexact Rounded
766ddqua1709 quantize  1.2399    1.00    ->  1.23  Inexact Rounded
767ddqua1711 quantize -1.2399    1.00    -> -1.24  Inexact Rounded
768
769rounding: 05up
770ddqua1800 quantize  1.2000    1.00    ->  1.20  Rounded
771ddqua1801 quantize  1.2001    1.00    ->  1.21  Inexact Rounded
772ddqua1802 quantize  1.2010    1.00    ->  1.21  Inexact Rounded
773ddqua1803 quantize  1.2050    1.00    ->  1.21  Inexact Rounded
774ddqua1804 quantize  1.2051    1.00    ->  1.21  Inexact Rounded
775ddqua1807 quantize  1.2060    1.00    ->  1.21  Inexact Rounded
776ddqua1808 quantize  1.2070    1.00    ->  1.21  Inexact Rounded
777ddqua1809 quantize  1.2099    1.00    ->  1.21  Inexact Rounded
778ddqua1811 quantize -1.2099    1.00    -> -1.21  Inexact Rounded
779
780ddqua1900 quantize  1.2100    1.00    ->  1.21  Rounded
781ddqua1901 quantize  1.2101    1.00    ->  1.21  Inexact Rounded
782ddqua1902 quantize  1.2110    1.00    ->  1.21  Inexact Rounded
783ddqua1903 quantize  1.2150    1.00    ->  1.21  Inexact Rounded
784ddqua1904 quantize  1.2151    1.00    ->  1.21  Inexact Rounded
785ddqua1907 quantize  1.2160    1.00    ->  1.21  Inexact Rounded
786ddqua1908 quantize  1.2170    1.00    ->  1.21  Inexact Rounded
787ddqua1909 quantize  1.2199    1.00    ->  1.21  Inexact Rounded
788ddqua1911 quantize -1.2199    1.00    -> -1.21  Inexact Rounded
789
790ddqua2000 quantize  1.2400    1.00    ->  1.24  Rounded
791ddqua2001 quantize  1.2401    1.00    ->  1.24  Inexact Rounded
792ddqua2002 quantize  1.2410    1.00    ->  1.24  Inexact Rounded
793ddqua2003 quantize  1.2450    1.00    ->  1.24  Inexact Rounded
794ddqua2004 quantize  1.2451    1.00    ->  1.24  Inexact Rounded
795ddqua2007 quantize  1.2460    1.00    ->  1.24  Inexact Rounded
796ddqua2008 quantize  1.2470    1.00    ->  1.24  Inexact Rounded
797ddqua2009 quantize  1.2499    1.00    ->  1.24  Inexact Rounded
798ddqua2011 quantize -1.2499    1.00    -> -1.24  Inexact Rounded
799
800ddqua2100 quantize  1.2500    1.00    ->  1.25  Rounded
801ddqua2101 quantize  1.2501    1.00    ->  1.26  Inexact Rounded
802ddqua2102 quantize  1.2510    1.00    ->  1.26  Inexact Rounded
803ddqua2103 quantize  1.2550    1.00    ->  1.26  Inexact Rounded
804ddqua2104 quantize  1.2551    1.00    ->  1.26  Inexact Rounded
805ddqua2107 quantize  1.2560    1.00    ->  1.26  Inexact Rounded
806ddqua2108 quantize  1.2570    1.00    ->  1.26  Inexact Rounded
807ddqua2109 quantize  1.2599    1.00    ->  1.26  Inexact Rounded
808ddqua2111 quantize -1.2599    1.00    -> -1.26  Inexact Rounded
809
810ddqua2200 quantize  1.2600    1.00    ->  1.26  Rounded
811ddqua2201 quantize  1.2601    1.00    ->  1.26  Inexact Rounded
812ddqua2202 quantize  1.2610    1.00    ->  1.26  Inexact Rounded
813ddqua2203 quantize  1.2650    1.00    ->  1.26  Inexact Rounded
814ddqua2204 quantize  1.2651    1.00    ->  1.26  Inexact Rounded
815ddqua2207 quantize  1.2660    1.00    ->  1.26  Inexact Rounded
816ddqua2208 quantize  1.2670    1.00    ->  1.26  Inexact Rounded
817ddqua2209 quantize  1.2699    1.00    ->  1.26  Inexact Rounded
818ddqua2211 quantize -1.2699    1.00    -> -1.26  Inexact Rounded
819
820ddqua2300 quantize  1.2900    1.00    ->  1.29  Rounded
821ddqua2301 quantize  1.2901    1.00    ->  1.29  Inexact Rounded
822ddqua2302 quantize  1.2910    1.00    ->  1.29  Inexact Rounded
823ddqua2303 quantize  1.2950    1.00    ->  1.29  Inexact Rounded
824ddqua2304 quantize  1.2951    1.00    ->  1.29  Inexact Rounded
825ddqua2307 quantize  1.2960    1.00    ->  1.29  Inexact Rounded
826ddqua2308 quantize  1.2970    1.00    ->  1.29  Inexact Rounded
827ddqua2309 quantize  1.2999    1.00    ->  1.29  Inexact Rounded
828ddqua2311 quantize -1.2999    1.00    -> -1.29  Inexact Rounded
829
830-- Null tests
831rounding:    half_even
832ddqua998 quantize 10    # -> NaN Invalid_operation
833ddqua999 quantize  # 1e10 -> NaN Invalid_operation
834