1------------------------------------------------------------------------
2-- dqEncode.decTest -- decimal sixteen-byte format testcases          --
3-- Copyright (c) IBM Corporation, 2000, 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-- [Previously called decimal128.decTest]
21version: 2.59
22
23-- This set of tests is for the sixteen-byte concrete representation.
24-- Its characteristics are:
25--
26--   1 bit  sign
27--   5 bits combination field
28--  12 bits exponent continuation
29-- 110 bits coefficient continuation
30--
31-- Total exponent length 14 bits
32-- Total coefficient length 114 bits (34 digits)
33--
34-- Elimit = 12287 (maximum encoded exponent)
35-- Emax   =  6144 (largest exponent value)
36-- Emin   = -6143 (smallest exponent value)
37-- bias   =  6176 (subtracted from encoded exponent) = -Etiny
38
39-- The testcases here have only exactly representable data on the
40-- 'left-hand-side'; rounding from strings is tested in 'base'
41-- testcase groups.
42
43extended:    1
44clamp:       1
45precision:   34
46rounding:    half_up
47maxExponent: 6144
48minExponent: -6143
49
50-- General testcases
51-- (mostly derived from the Strawman 4 document and examples)
52decq001 apply   #A20780000000000000000000000003D0 -> -7.50
53decq002 apply   -7.50             -> #A20780000000000000000000000003D0
54-- derivative canonical plain strings
55decq003 apply   #A20840000000000000000000000003D0 -> -7.50E+3
56decq004 apply   -7.50E+3          -> #A20840000000000000000000000003D0
57decq005 apply   #A20800000000000000000000000003D0 -> -750
58decq006 apply   -750              -> #A20800000000000000000000000003D0
59decq007 apply   #A207c0000000000000000000000003D0 -> -75.0
60decq008 apply   -75.0             -> #A207c0000000000000000000000003D0
61decq009 apply   #A20740000000000000000000000003D0 -> -0.750
62decq010 apply   -0.750            -> #A20740000000000000000000000003D0
63decq011 apply   #A20700000000000000000000000003D0 -> -0.0750
64decq012 apply   -0.0750           -> #A20700000000000000000000000003D0
65decq013 apply   #A20680000000000000000000000003D0 -> -0.000750
66decq014 apply   -0.000750         -> #A20680000000000000000000000003D0
67decq015 apply   #A20600000000000000000000000003D0 -> -0.00000750
68decq016 apply   -0.00000750       -> #A20600000000000000000000000003D0
69decq017 apply   #A205c0000000000000000000000003D0 -> -7.50E-7
70decq018 apply   -7.50E-7          -> #A205c0000000000000000000000003D0
71
72-- Normality
73decq020 apply   1234567890123456789012345678901234   -> #2608134b9c1e28e56f3c127177823534
74decq021 apply  -1234567890123456789012345678901234   -> #a608134b9c1e28e56f3c127177823534
75decq022 apply   1111111111111111111111111111111111   -> #26080912449124491244912449124491
76
77-- Nmax and similar
78decq031 apply   9.999999999999999999999999999999999E+6144  -> #77ffcff3fcff3fcff3fcff3fcff3fcff
79decq032 apply   #77ffcff3fcff3fcff3fcff3fcff3fcff -> 9.999999999999999999999999999999999E+6144
80decq033 apply   1.234567890123456789012345678901234E+6144 -> #47ffd34b9c1e28e56f3c127177823534
81decq034 apply   #47ffd34b9c1e28e56f3c127177823534 -> 1.234567890123456789012345678901234E+6144
82-- fold-downs (more below)
83decq035 apply   1.23E+6144    -> #47ffd300000000000000000000000000 Clamped
84decq036 apply   #47ffd300000000000000000000000000       -> 1.230000000000000000000000000000000E+6144
85decq037 apply   1E+6144       -> #47ffc000000000000000000000000000 Clamped
86decq038 apply   #47ffc000000000000000000000000000       -> 1.000000000000000000000000000000000E+6144
87
88decq051 apply   12345                   -> #220800000000000000000000000049c5
89decq052 apply   #220800000000000000000000000049c5       -> 12345
90decq053 apply   1234                    -> #22080000000000000000000000000534
91decq054 apply   #22080000000000000000000000000534       -> 1234
92decq055 apply   123                     -> #220800000000000000000000000000a3
93decq056 apply   #220800000000000000000000000000a3       -> 123
94decq057 apply   12                      -> #22080000000000000000000000000012
95decq058 apply   #22080000000000000000000000000012       -> 12
96decq059 apply   1                       -> #22080000000000000000000000000001
97decq060 apply   #22080000000000000000000000000001       -> 1
98decq061 apply   1.23                    -> #220780000000000000000000000000a3
99decq062 apply   #220780000000000000000000000000a3       -> 1.23
100decq063 apply   123.45                  -> #220780000000000000000000000049c5
101decq064 apply   #220780000000000000000000000049c5       -> 123.45
102
103-- Nmin and below
104decq071 apply   1E-6143                                    -> #00084000000000000000000000000001
105decq072 apply   #00084000000000000000000000000001          -> 1E-6143
106decq073 apply   1.000000000000000000000000000000000E-6143  -> #04000000000000000000000000000000
107decq074 apply   #04000000000000000000000000000000          -> 1.000000000000000000000000000000000E-6143
108decq075 apply   1.000000000000000000000000000000001E-6143  -> #04000000000000000000000000000001
109decq076 apply   #04000000000000000000000000000001          -> 1.000000000000000000000000000000001E-6143
110
111decq077 apply   0.100000000000000000000000000000000E-6143  -> #00000800000000000000000000000000      Subnormal
112decq078 apply   #00000800000000000000000000000000          -> 1.00000000000000000000000000000000E-6144  Subnormal
113decq079 apply   0.000000000000000000000000000000010E-6143  -> #00000000000000000000000000000010      Subnormal
114decq080 apply   #00000000000000000000000000000010          -> 1.0E-6175              Subnormal
115decq081 apply   0.00000000000000000000000000000001E-6143   -> #00004000000000000000000000000001      Subnormal
116decq082 apply   #00004000000000000000000000000001          -> 1E-6175                Subnormal
117decq083 apply   0.000000000000000000000000000000001E-6143  -> #00000000000000000000000000000001      Subnormal
118decq084 apply   #00000000000000000000000000000001          -> 1E-6176                 Subnormal
119
120-- underflows cannot be tested for simple copies, check edge cases
121decq090 apply   1e-6176                  -> #00000000000000000000000000000001  Subnormal
122decq100 apply   999999999999999999999999999999999e-6176 -> #00000ff3fcff3fcff3fcff3fcff3fcff  Subnormal
123
124-- same again, negatives
125-- Nmax and similar
126decq122 apply  -9.999999999999999999999999999999999E+6144  -> #f7ffcff3fcff3fcff3fcff3fcff3fcff
127decq123 apply   #f7ffcff3fcff3fcff3fcff3fcff3fcff -> -9.999999999999999999999999999999999E+6144
128decq124 apply  -1.234567890123456789012345678901234E+6144 -> #c7ffd34b9c1e28e56f3c127177823534
129decq125 apply   #c7ffd34b9c1e28e56f3c127177823534 -> -1.234567890123456789012345678901234E+6144
130-- fold-downs (more below)
131decq130 apply  -1.23E+6144    -> #c7ffd300000000000000000000000000 Clamped
132decq131 apply   #c7ffd300000000000000000000000000       -> -1.230000000000000000000000000000000E+6144
133decq132 apply  -1E+6144       -> #c7ffc000000000000000000000000000 Clamped
134decq133 apply   #c7ffc000000000000000000000000000       -> -1.000000000000000000000000000000000E+6144
135
136decq151 apply  -12345                   -> #a20800000000000000000000000049c5
137decq152 apply   #a20800000000000000000000000049c5       -> -12345
138decq153 apply  -1234                    -> #a2080000000000000000000000000534
139decq154 apply   #a2080000000000000000000000000534       -> -1234
140decq155 apply  -123                     -> #a20800000000000000000000000000a3
141decq156 apply   #a20800000000000000000000000000a3       -> -123
142decq157 apply  -12                      -> #a2080000000000000000000000000012
143decq158 apply   #a2080000000000000000000000000012       -> -12
144decq159 apply  -1                       -> #a2080000000000000000000000000001
145decq160 apply   #a2080000000000000000000000000001       -> -1
146decq161 apply  -1.23                    -> #a20780000000000000000000000000a3
147decq162 apply   #a20780000000000000000000000000a3       -> -1.23
148decq163 apply  -123.45                  -> #a20780000000000000000000000049c5
149decq164 apply   #a20780000000000000000000000049c5       -> -123.45
150
151-- Nmin and below
152decq171 apply  -1E-6143                                    -> #80084000000000000000000000000001
153decq172 apply   #80084000000000000000000000000001          -> -1E-6143
154decq173 apply  -1.000000000000000000000000000000000E-6143  -> #84000000000000000000000000000000
155decq174 apply   #84000000000000000000000000000000          -> -1.000000000000000000000000000000000E-6143
156decq175 apply  -1.000000000000000000000000000000001E-6143  -> #84000000000000000000000000000001
157decq176 apply   #84000000000000000000000000000001          -> -1.000000000000000000000000000000001E-6143
158
159decq177 apply  -0.100000000000000000000000000000000E-6143  -> #80000800000000000000000000000000      Subnormal
160decq178 apply   #80000800000000000000000000000000          -> -1.00000000000000000000000000000000E-6144  Subnormal
161decq179 apply  -0.000000000000000000000000000000010E-6143  -> #80000000000000000000000000000010      Subnormal
162decq180 apply   #80000000000000000000000000000010          -> -1.0E-6175              Subnormal
163decq181 apply  -0.00000000000000000000000000000001E-6143   -> #80004000000000000000000000000001      Subnormal
164decq182 apply   #80004000000000000000000000000001          -> -1E-6175                Subnormal
165decq183 apply  -0.000000000000000000000000000000001E-6143  -> #80000000000000000000000000000001      Subnormal
166decq184 apply   #80000000000000000000000000000001          -> -1E-6176                 Subnormal
167
168-- underflow edge cases
169decq190 apply   -1e-6176                  -> #80000000000000000000000000000001  Subnormal
170decq200 apply   -999999999999999999999999999999999e-6176 -> #80000ff3fcff3fcff3fcff3fcff3fcff  Subnormal
171
172-- zeros
173decq400 apply   0E-8000                 -> #00000000000000000000000000000000  Clamped
174decq401 apply   0E-6177                 -> #00000000000000000000000000000000  Clamped
175decq402 apply   0E-6176                 -> #00000000000000000000000000000000
176decq403 apply   #00000000000000000000000000000000       -> 0E-6176
177decq404 apply   0.000000000000000000000000000000000E-6143  -> #00000000000000000000000000000000
178decq405 apply   #00000000000000000000000000000000       -> 0E-6176
179decq406 apply   0E-2                    -> #22078000000000000000000000000000
180decq407 apply   #22078000000000000000000000000000       -> 0.00
181decq408 apply   0                       -> #22080000000000000000000000000000
182decq409 apply   #22080000000000000000000000000000       -> 0
183decq410 apply   0E+3                    -> #2208c000000000000000000000000000
184decq411 apply   #2208c000000000000000000000000000       -> 0E+3
185decq412 apply   0E+6111                 -> #43ffc000000000000000000000000000
186decq413 apply   #43ffc000000000000000000000000000       -> 0E+6111
187-- clamped zeros...
188decq414 apply   0E+6112                 -> #43ffc000000000000000000000000000  Clamped
189decq415 apply   #43ffc000000000000000000000000000       -> 0E+6111
190decq416 apply   0E+6144                 -> #43ffc000000000000000000000000000  Clamped
191decq417 apply   #43ffc000000000000000000000000000       -> 0E+6111
192decq418 apply   0E+8000                 -> #43ffc000000000000000000000000000  Clamped
193decq419 apply   #43ffc000000000000000000000000000       -> 0E+6111
194
195-- negative zeros
196decq420 apply  -0E-8000                 -> #80000000000000000000000000000000  Clamped
197decq421 apply  -0E-6177                 -> #80000000000000000000000000000000  Clamped
198decq422 apply  -0E-6176                 -> #80000000000000000000000000000000
199decq423 apply   #80000000000000000000000000000000       -> -0E-6176
200decq424 apply  -0.000000000000000000000000000000000E-6143  -> #80000000000000000000000000000000
201decq425 apply   #80000000000000000000000000000000       -> -0E-6176
202decq426 apply  -0E-2                    -> #a2078000000000000000000000000000
203decq427 apply   #a2078000000000000000000000000000       -> -0.00
204decq428 apply  -0                       -> #a2080000000000000000000000000000
205decq429 apply   #a2080000000000000000000000000000       -> -0
206decq430 apply  -0E+3                    -> #a208c000000000000000000000000000
207decq431 apply   #a208c000000000000000000000000000       -> -0E+3
208decq432 apply  -0E+6111                 -> #c3ffc000000000000000000000000000
209decq433 apply   #c3ffc000000000000000000000000000       -> -0E+6111
210-- clamped zeros...
211decq434 apply  -0E+6112                 -> #c3ffc000000000000000000000000000  Clamped
212decq435 apply   #c3ffc000000000000000000000000000       -> -0E+6111
213decq436 apply  -0E+6144                 -> #c3ffc000000000000000000000000000  Clamped
214decq437 apply   #c3ffc000000000000000000000000000       -> -0E+6111
215decq438 apply  -0E+8000                 -> #c3ffc000000000000000000000000000  Clamped
216decq439 apply   #c3ffc000000000000000000000000000       -> -0E+6111
217
218-- exponent lengths
219decq440 apply   #22080000000000000000000000000007       -> 7
220decq441 apply   7 -> #22080000000000000000000000000007
221decq442 apply   #220a4000000000000000000000000007       -> 7E+9
222decq443 apply   7E+9 -> #220a4000000000000000000000000007
223decq444 apply   #2220c000000000000000000000000007       -> 7E+99
224decq445 apply   7E+99 -> #2220c000000000000000000000000007
225decq446 apply   #2301c000000000000000000000000007       -> 7E+999
226decq447 apply   7E+999 -> #2301c000000000000000000000000007
227decq448 apply   #43e3c000000000000000000000000007       -> 7E+5999
228decq449 apply   7E+5999 -> #43e3c000000000000000000000000007
229
230-- Specials
231decq500 apply   Infinity                          -> #78000000000000000000000000000000
232decq501 apply   #78787878787878787878787878787878 -> #78000000000000000000000000000000
233decq502 apply   #78000000000000000000000000000000 -> Infinity
234decq503 apply   #79797979797979797979797979797979 -> #78000000000000000000000000000000
235decq504 apply   #79000000000000000000000000000000 -> Infinity
236decq505 apply   #7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a -> #78000000000000000000000000000000
237decq506 apply   #7a000000000000000000000000000000 -> Infinity
238decq507 apply   #7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b -> #78000000000000000000000000000000
239decq508 apply   #7b000000000000000000000000000000 -> Infinity
240
241decq509 apply   NaN                               -> #7c000000000000000000000000000000
242decq510 apply   #7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c -> #7c003c7c7c7c7c7c7c7c7c7c7c7c7c7c
243decq511 apply   #7c000000000000000000000000000000 -> NaN
244decq512 apply   #7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d -> #7c003d7d7d7d7d7d7d7d7d7d7d7d7d7d
245decq513 apply   #7d000000000000000000000000000000 -> NaN
246decq514 apply   #7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e -> #7e003e7e7c7e7e7e7e7c7e7e7e7e7c7e
247decq515 apply   #7e000000000000000000000000000000 -> sNaN
248decq516 apply   #7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f -> #7e003f7f7c7f7f7f7f7c7f7f7f7f7c7f
249decq517 apply   #7f000000000000000000000000000000 -> sNaN
250decq518 apply   #7fffffffffffffffffffffffffffffff -> sNaN999999999999999999999999999999999
251decq519 apply   #7fffffffffffffffffffffffffffffff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
252
253decq520 apply   -Infinity                         -> #f8000000000000000000000000000000
254decq521 apply   #f8787878787878787878787878787878 -> #f8000000000000000000000000000000
255decq522 apply   #f8000000000000000000000000000000 -> -Infinity
256decq523 apply   #f9797979797979797979797979797979 -> #f8000000000000000000000000000000
257decq524 apply   #f9000000000000000000000000000000 -> -Infinity
258decq525 apply   #fa7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a -> #f8000000000000000000000000000000
259decq526 apply   #fa000000000000000000000000000000 -> -Infinity
260decq527 apply   #fb7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b -> #f8000000000000000000000000000000
261decq528 apply   #fb000000000000000000000000000000 -> -Infinity
262
263decq529 apply   -NaN                              -> #fc000000000000000000000000000000
264decq530 apply   #fc7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c -> #fc003c7c7c7c7c7c7c7c7c7c7c7c7c7c
265decq531 apply   #fc000000000000000000000000000000 -> -NaN
266decq532 apply   #fd7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d -> #fc003d7d7d7d7d7d7d7d7d7d7d7d7d7d
267decq533 apply   #fd000000000000000000000000000000 -> -NaN
268decq534 apply   #fe7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e -> #fe003e7e7c7e7e7e7e7c7e7e7e7e7c7e
269decq535 apply   #fe000000000000000000000000000000 -> -sNaN
270decq536 apply   #ff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f -> #fe003f7f7c7f7f7f7f7c7f7f7f7f7c7f
271decq537 apply   #ff000000000000000000000000000000 -> -sNaN
272decq538 apply   #ffffffffffffffffffffffffffffffff -> -sNaN999999999999999999999999999999999
273decq539 apply   #ffffffffffffffffffffffffffffffff -> #fe000ff3fcff3fcff3fcff3fcff3fcff
274
275decq540 apply   NaN               -> #7c000000000000000000000000000000
276decq541 apply   NaN0              -> #7c000000000000000000000000000000
277decq542 apply   NaN1              -> #7c000000000000000000000000000001
278decq543 apply   NaN12             -> #7c000000000000000000000000000012
279decq544 apply   NaN79             -> #7c000000000000000000000000000079
280decq545 apply   NaN12345          -> #7c0000000000000000000000000049c5
281decq546 apply   NaN123456         -> #7c000000000000000000000000028e56
282decq547 apply   NaN799799         -> #7c0000000000000000000000000f7fdf
283decq548 apply   NaN799799799799799799799799799799799  -> #7c003dff7fdff7fdff7fdff7fdff7fdf
284decq549 apply   NaN999999999999999999999999999999999  -> #7c000ff3fcff3fcff3fcff3fcff3fcff
285decq550 apply     9999999999999999999999999999999999  -> #6e080ff3fcff3fcff3fcff3fcff3fcff
286
287-- fold-down full sequence
288decq601 apply   1E+6144                 -> #47ffc000000000000000000000000000 Clamped
289decq602 apply   #47ffc000000000000000000000000000       -> 1.000000000000000000000000000000000E+6144
290decq603 apply   1E+6143                 -> #43ffc800000000000000000000000000 Clamped
291decq604 apply   #43ffc800000000000000000000000000       -> 1.00000000000000000000000000000000E+6143
292decq605 apply   1E+6142                 -> #43ffc100000000000000000000000000 Clamped
293decq606 apply   #43ffc100000000000000000000000000       -> 1.0000000000000000000000000000000E+6142
294decq607 apply   1E+6141                 -> #43ffc010000000000000000000000000 Clamped
295decq608 apply   #43ffc010000000000000000000000000       -> 1.000000000000000000000000000000E+6141
296decq609 apply   1E+6140                 -> #43ffc002000000000000000000000000 Clamped
297decq610 apply   #43ffc002000000000000000000000000       -> 1.00000000000000000000000000000E+6140
298decq611 apply   1E+6139                 -> #43ffc000400000000000000000000000 Clamped
299decq612 apply   #43ffc000400000000000000000000000       -> 1.0000000000000000000000000000E+6139
300decq613 apply   1E+6138                 -> #43ffc000040000000000000000000000 Clamped
301decq614 apply   #43ffc000040000000000000000000000       -> 1.000000000000000000000000000E+6138
302decq615 apply   1E+6137                 -> #43ffc000008000000000000000000000 Clamped
303decq616 apply   #43ffc000008000000000000000000000       -> 1.00000000000000000000000000E+6137
304decq617 apply   1E+6136                 -> #43ffc000001000000000000000000000 Clamped
305decq618 apply   #43ffc000001000000000000000000000       -> 1.0000000000000000000000000E+6136
306decq619 apply   1E+6135                 -> #43ffc000000100000000000000000000 Clamped
307decq620 apply   #43ffc000000100000000000000000000       -> 1.000000000000000000000000E+6135
308decq621 apply   1E+6134                 -> #43ffc000000020000000000000000000 Clamped
309decq622 apply   #43ffc000000020000000000000000000       -> 1.00000000000000000000000E+6134
310decq623 apply   1E+6133                 -> #43ffc000000004000000000000000000 Clamped
311decq624 apply   #43ffc000000004000000000000000000       -> 1.0000000000000000000000E+6133
312decq625 apply   1E+6132                 -> #43ffc000000000400000000000000000 Clamped
313decq626 apply   #43ffc000000000400000000000000000       -> 1.000000000000000000000E+6132
314decq627 apply   1E+6131                 -> #43ffc000000000080000000000000000 Clamped
315decq628 apply   #43ffc000000000080000000000000000       -> 1.00000000000000000000E+6131
316decq629 apply   1E+6130                 -> #43ffc000000000010000000000000000 Clamped
317decq630 apply   #43ffc000000000010000000000000000       -> 1.0000000000000000000E+6130
318decq631 apply   1E+6129                 -> #43ffc000000000001000000000000000 Clamped
319decq632 apply   #43ffc000000000001000000000000000       -> 1.000000000000000000E+6129
320decq633 apply   1E+6128                 -> #43ffc000000000000200000000000000 Clamped
321decq634 apply   #43ffc000000000000200000000000000       -> 1.00000000000000000E+6128
322decq635 apply   1E+6127                 -> #43ffc000000000000040000000000000 Clamped
323decq636 apply   #43ffc000000000000040000000000000       -> 1.0000000000000000E+6127
324decq637 apply   1E+6126                 -> #43ffc000000000000004000000000000 Clamped
325decq638 apply   #43ffc000000000000004000000000000       -> 1.000000000000000E+6126
326decq639 apply   1E+6125                 -> #43ffc000000000000000800000000000 Clamped
327decq640 apply   #43ffc000000000000000800000000000       -> 1.00000000000000E+6125
328decq641 apply   1E+6124                 -> #43ffc000000000000000100000000000 Clamped
329decq642 apply   #43ffc000000000000000100000000000       -> 1.0000000000000E+6124
330decq643 apply   1E+6123                 -> #43ffc000000000000000010000000000 Clamped
331decq644 apply   #43ffc000000000000000010000000000       -> 1.000000000000E+6123
332decq645 apply   1E+6122                 -> #43ffc000000000000000002000000000 Clamped
333decq646 apply   #43ffc000000000000000002000000000       -> 1.00000000000E+6122
334decq647 apply   1E+6121                 -> #43ffc000000000000000000400000000 Clamped
335decq648 apply   #43ffc000000000000000000400000000       -> 1.0000000000E+6121
336decq649 apply   1E+6120                 -> #43ffc000000000000000000040000000 Clamped
337decq650 apply   #43ffc000000000000000000040000000       -> 1.000000000E+6120
338decq651 apply   1E+6119                 -> #43ffc000000000000000000008000000 Clamped
339decq652 apply   #43ffc000000000000000000008000000       -> 1.00000000E+6119
340decq653 apply   1E+6118                 -> #43ffc000000000000000000001000000 Clamped
341decq654 apply   #43ffc000000000000000000001000000       -> 1.0000000E+6118
342decq655 apply   1E+6117                 -> #43ffc000000000000000000000100000 Clamped
343decq656 apply   #43ffc000000000000000000000100000       -> 1.000000E+6117
344decq657 apply   1E+6116                 -> #43ffc000000000000000000000020000 Clamped
345decq658 apply   #43ffc000000000000000000000020000       -> 1.00000E+6116
346decq659 apply   1E+6115                 -> #43ffc000000000000000000000004000 Clamped
347decq660 apply   #43ffc000000000000000000000004000       -> 1.0000E+6115
348decq661 apply   1E+6114                 -> #43ffc000000000000000000000000400 Clamped
349decq662 apply   #43ffc000000000000000000000000400       -> 1.000E+6114
350decq663 apply   1E+6113                 -> #43ffc000000000000000000000000080 Clamped
351decq664 apply   #43ffc000000000000000000000000080       -> 1.00E+6113
352decq665 apply   1E+6112                 -> #43ffc000000000000000000000000010 Clamped
353decq666 apply   #43ffc000000000000000000000000010       -> 1.0E+6112
354decq667 apply   1E+6111                 -> #43ffc000000000000000000000000001
355decq668 apply   #43ffc000000000000000000000000001       -> 1E+6111
356decq669 apply   1E+6110                 -> #43ff8000000000000000000000000001
357decq670 apply   #43ff8000000000000000000000000001       -> 1E+6110
358
359-- Selected DPD codes
360decq700 apply   #22080000000000000000000000000000       -> 0
361decq701 apply   #22080000000000000000000000000009       -> 9
362decq702 apply   #22080000000000000000000000000010       -> 10
363decq703 apply   #22080000000000000000000000000019       -> 19
364decq704 apply   #22080000000000000000000000000020       -> 20
365decq705 apply   #22080000000000000000000000000029       -> 29
366decq706 apply   #22080000000000000000000000000030       -> 30
367decq707 apply   #22080000000000000000000000000039       -> 39
368decq708 apply   #22080000000000000000000000000040       -> 40
369decq709 apply   #22080000000000000000000000000049       -> 49
370decq710 apply   #22080000000000000000000000000050       -> 50
371decq711 apply   #22080000000000000000000000000059       -> 59
372decq712 apply   #22080000000000000000000000000060       -> 60
373decq713 apply   #22080000000000000000000000000069       -> 69
374decq714 apply   #22080000000000000000000000000070       -> 70
375decq715 apply   #22080000000000000000000000000071       -> 71
376decq716 apply   #22080000000000000000000000000072       -> 72
377decq717 apply   #22080000000000000000000000000073       -> 73
378decq718 apply   #22080000000000000000000000000074       -> 74
379decq719 apply   #22080000000000000000000000000075       -> 75
380decq720 apply   #22080000000000000000000000000076       -> 76
381decq721 apply   #22080000000000000000000000000077       -> 77
382decq722 apply   #22080000000000000000000000000078       -> 78
383decq723 apply   #22080000000000000000000000000079       -> 79
384
385decq730 apply   #2208000000000000000000000000029e       -> 994
386decq731 apply   #2208000000000000000000000000029f       -> 995
387decq732 apply   #220800000000000000000000000002a0       -> 520
388decq733 apply   #220800000000000000000000000002a1       -> 521
389
390-- DPD: one of each of the huffman groups
391decq740 apply   #220800000000000000000000000003f7       -> 777
392decq741 apply   #220800000000000000000000000003f8       -> 778
393decq742 apply   #220800000000000000000000000003eb       -> 787
394decq743 apply   #2208000000000000000000000000037d       -> 877
395decq744 apply   #2208000000000000000000000000039f       -> 997
396decq745 apply   #220800000000000000000000000003bf       -> 979
397decq746 apply   #220800000000000000000000000003df       -> 799
398decq747 apply   #2208000000000000000000000000006e       -> 888
399
400
401-- DPD all-highs cases (includes the 24 redundant codes)
402decq750 apply   #2208000000000000000000000000006e       -> 888
403decq751 apply   #2208000000000000000000000000016e       -> 888
404decq752 apply   #2208000000000000000000000000026e       -> 888
405decq753 apply   #2208000000000000000000000000036e       -> 888
406decq754 apply   #2208000000000000000000000000006f       -> 889
407decq755 apply   #2208000000000000000000000000016f       -> 889
408decq756 apply   #2208000000000000000000000000026f       -> 889
409decq757 apply   #2208000000000000000000000000036f       -> 889
410
411decq760 apply   #2208000000000000000000000000007e       -> 898
412decq761 apply   #2208000000000000000000000000017e       -> 898
413decq762 apply   #2208000000000000000000000000027e       -> 898
414decq763 apply   #2208000000000000000000000000037e       -> 898
415decq764 apply   #2208000000000000000000000000007f       -> 899
416decq765 apply   #2208000000000000000000000000017f       -> 899
417decq766 apply   #2208000000000000000000000000027f       -> 899
418decq767 apply   #2208000000000000000000000000037f       -> 899
419
420decq770 apply   #220800000000000000000000000000ee       -> 988
421decq771 apply   #220800000000000000000000000001ee       -> 988
422decq772 apply   #220800000000000000000000000002ee       -> 988
423decq773 apply   #220800000000000000000000000003ee       -> 988
424decq774 apply   #220800000000000000000000000000ef       -> 989
425decq775 apply   #220800000000000000000000000001ef       -> 989
426decq776 apply   #220800000000000000000000000002ef       -> 989
427decq777 apply   #220800000000000000000000000003ef       -> 989
428
429decq780 apply   #220800000000000000000000000000fe       -> 998
430decq781 apply   #220800000000000000000000000001fe       -> 998
431decq782 apply   #220800000000000000000000000002fe       -> 998
432decq783 apply   #220800000000000000000000000003fe       -> 998
433decq784 apply   #220800000000000000000000000000ff       -> 999
434decq785 apply   #220800000000000000000000000001ff       -> 999
435decq786 apply   #220800000000000000000000000002ff       -> 999
436decq787 apply   #220800000000000000000000000003ff       -> 999
437
438-- Miscellaneous (testers' queries, etc.)
439
440decq790 apply   #2208000000000000000000000000c000       -> 30000
441decq791 apply   #22080000000000000000000000007800       -> 890000
442decq792 apply   30000 -> #2208000000000000000000000000c000
443decq793 apply   890000 -> #22080000000000000000000000007800
444
445-- values around [u]int32 edges (zeros done earlier)
446decq800 apply -2147483646  -> #a208000000000000000000008c78af46
447decq801 apply -2147483647  -> #a208000000000000000000008c78af47
448decq802 apply -2147483648  -> #a208000000000000000000008c78af48
449decq803 apply -2147483649  -> #a208000000000000000000008c78af49
450decq804 apply  2147483646  -> #2208000000000000000000008c78af46
451decq805 apply  2147483647  -> #2208000000000000000000008c78af47
452decq806 apply  2147483648  -> #2208000000000000000000008c78af48
453decq807 apply  2147483649  -> #2208000000000000000000008c78af49
454decq808 apply  4294967294  -> #22080000000000000000000115afb55a
455decq809 apply  4294967295  -> #22080000000000000000000115afb55b
456decq810 apply  4294967296  -> #22080000000000000000000115afb57a
457decq811 apply  4294967297  -> #22080000000000000000000115afb57b
458
459decq820 apply  #a208000000000000000000008c78af46 -> -2147483646
460decq821 apply  #a208000000000000000000008c78af47 -> -2147483647
461decq822 apply  #a208000000000000000000008c78af48 -> -2147483648
462decq823 apply  #a208000000000000000000008c78af49 -> -2147483649
463decq824 apply  #2208000000000000000000008c78af46 ->  2147483646
464decq825 apply  #2208000000000000000000008c78af47 ->  2147483647
465decq826 apply  #2208000000000000000000008c78af48 ->  2147483648
466decq827 apply  #2208000000000000000000008c78af49 ->  2147483649
467decq828 apply  #22080000000000000000000115afb55a ->  4294967294
468decq829 apply  #22080000000000000000000115afb55b ->  4294967295
469decq830 apply  #22080000000000000000000115afb57a ->  4294967296
470decq831 apply  #22080000000000000000000115afb57b ->  4294967297
471
472-- VG testcase
473decq840 apply    #2080000000000000F294000000172636 -> 8.81125000000001349436E-1548
474decq841 apply    #20800000000000008000000000000000 -> 8.000000000000000000E-1550
475decq842 apply    #1EF98490000000010F6E4E0000000000 -> 7.049000000000010795488000000000000E-3097
476decq843 multiply #20800000000000008000000000000000 #2080000000000000F294000000172636 -> #1EF98490000000010F6E4E0000000000 Rounded
477
478