PageRenderTime 671ms CodeModel.GetById 143ms app.highlight 157ms RepoModel.GetById 144ms app.codeStats 2ms

/Lib/test/decimaltestdata/ddAdd.decTest

http://unladen-swallow.googlecode.com/
Unknown | 1328 lines | 1226 code | 102 blank | 0 comment | 0 complexity | bec50909cd0296a44e68afc13ccc7a9b MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1------------------------------------------------------------------------
  2-- ddAdd.decTest -- decDouble addition                                --
  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.58
 21
 22-- This set of tests are for decDoubles only; all arguments are
 23-- representable in a decDouble
 24precision:   16
 25maxExponent: 384
 26minExponent: -383
 27extended:    1
 28clamp:       1
 29rounding:    half_even
 30
 31-- [first group are 'quick confidence check']
 32ddadd001 add 1       1       ->  2
 33ddadd002 add 2       3       ->  5
 34ddadd003 add '5.75'  '3.3'   ->  9.05
 35ddadd004 add '5'     '-3'    ->  2
 36ddadd005 add '-5'    '-3'    ->  -8
 37ddadd006 add '-7'    '2.5'   ->  -4.5
 38ddadd007 add '0.7'   '0.3'   ->  1.0
 39ddadd008 add '1.25'  '1.25'  ->  2.50
 40ddadd009 add '1.23456789'  '1.00000000' -> '2.23456789'
 41ddadd010 add '1.23456789'  '1.00000011' -> '2.23456800'
 42
 43--             1234567890123456      1234567890123456
 44ddadd011 add '0.4444444444444446'  '0.5555555555555555' -> '1.000000000000000' Inexact Rounded
 45ddadd012 add '0.4444444444444445'  '0.5555555555555555' -> '1.000000000000000' Rounded
 46ddadd013 add '0.4444444444444444'  '0.5555555555555555' -> '0.9999999999999999'
 47ddadd014 add   '4444444444444444' '0.49'   -> '4444444444444444' Inexact Rounded
 48ddadd015 add   '4444444444444444' '0.499'  -> '4444444444444444' Inexact Rounded
 49ddadd016 add   '4444444444444444' '0.4999' -> '4444444444444444' Inexact Rounded
 50ddadd017 add   '4444444444444444' '0.5000' -> '4444444444444444' Inexact Rounded
 51ddadd018 add   '4444444444444444' '0.5001' -> '4444444444444445' Inexact Rounded
 52ddadd019 add   '4444444444444444' '0.501'  -> '4444444444444445' Inexact Rounded
 53ddadd020 add   '4444444444444444' '0.51'   -> '4444444444444445' Inexact Rounded
 54
 55ddadd021 add 0 1 -> 1
 56ddadd022 add 1 1 -> 2
 57ddadd023 add 2 1 -> 3
 58ddadd024 add 3 1 -> 4
 59ddadd025 add 4 1 -> 5
 60ddadd026 add 5 1 -> 6
 61ddadd027 add 6 1 -> 7
 62ddadd028 add 7 1 -> 8
 63ddadd029 add 8 1 -> 9
 64ddadd030 add 9 1 -> 10
 65
 66-- some carrying effects
 67ddadd031 add '0.9998'  '0.0000' -> '0.9998'
 68ddadd032 add '0.9998'  '0.0001' -> '0.9999'
 69ddadd033 add '0.9998'  '0.0002' -> '1.0000'
 70ddadd034 add '0.9998'  '0.0003' -> '1.0001'
 71
 72ddadd035 add '70'  '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
 73ddadd036 add '700'  '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
 74ddadd037 add '7000'  '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
 75ddadd038 add '70000'  '10000e+16' -> '1.000000000000001E+20' Inexact Rounded
 76ddadd039 add '700000'  '10000e+16' -> '1.000000000000007E+20' Rounded
 77
 78-- symmetry:
 79ddadd040 add '10000e+16'  '70' -> '1.000000000000000E+20' Inexact Rounded
 80ddadd041 add '10000e+16'  '700' -> '1.000000000000000E+20' Inexact Rounded
 81ddadd042 add '10000e+16'  '7000' -> '1.000000000000000E+20' Inexact Rounded
 82ddadd044 add '10000e+16'  '70000' -> '1.000000000000001E+20' Inexact Rounded
 83ddadd045 add '10000e+16'  '700000' -> '1.000000000000007E+20' Rounded
 84
 85-- same, without rounding
 86ddadd046 add '10000e+9'  '7' -> '10000000000007'
 87ddadd047 add '10000e+9'  '70' -> '10000000000070'
 88ddadd048 add '10000e+9'  '700' -> '10000000000700'
 89ddadd049 add '10000e+9'  '7000' -> '10000000007000'
 90ddadd050 add '10000e+9'  '70000' -> '10000000070000'
 91ddadd051 add '10000e+9'  '700000' -> '10000000700000'
 92ddadd052 add '10000e+9'  '7000000' -> '10000007000000'
 93
 94-- examples from decarith
 95ddadd053 add '12' '7.00' -> '19.00'
 96ddadd054 add '1.3' '-1.07' -> '0.23'
 97ddadd055 add '1.3' '-1.30' -> '0.00'
 98ddadd056 add '1.3' '-2.07' -> '-0.77'
 99ddadd057 add '1E+2' '1E+4' -> '1.01E+4'
100
101-- leading zero preservation
102ddadd061 add 1 '0.0001' -> '1.0001'
103ddadd062 add 1 '0.00001' -> '1.00001'
104ddadd063 add 1 '0.000001' -> '1.000001'
105ddadd064 add 1 '0.0000001' -> '1.0000001'
106ddadd065 add 1 '0.00000001' -> '1.00000001'
107
108-- some funny zeros [in case of bad signum]
109ddadd070 add 1  0    -> 1
110ddadd071 add 1 0.    -> 1
111ddadd072 add 1  .0   -> 1.0
112ddadd073 add 1 0.0   -> 1.0
113ddadd074 add 1 0.00  -> 1.00
114ddadd075 add  0  1   -> 1
115ddadd076 add 0.  1   -> 1
116ddadd077 add  .0 1   -> 1.0
117ddadd078 add 0.0 1   -> 1.0
118ddadd079 add 0.00 1  -> 1.00
119
120-- some carries
121ddadd080 add 999999998 1  -> 999999999
122ddadd081 add 999999999 1  -> 1000000000
123ddadd082 add  99999999 1  -> 100000000
124ddadd083 add   9999999 1  -> 10000000
125ddadd084 add    999999 1  -> 1000000
126ddadd085 add     99999 1  -> 100000
127ddadd086 add      9999 1  -> 10000
128ddadd087 add       999 1  -> 1000
129ddadd088 add        99 1  -> 100
130ddadd089 add         9 1  -> 10
131
132
133-- more LHS swaps
134ddadd090 add '-56267E-10'   0 ->  '-0.0000056267'
135ddadd091 add '-56267E-6'    0 ->  '-0.056267'
136ddadd092 add '-56267E-5'    0 ->  '-0.56267'
137ddadd093 add '-56267E-4'    0 ->  '-5.6267'
138ddadd094 add '-56267E-3'    0 ->  '-56.267'
139ddadd095 add '-56267E-2'    0 ->  '-562.67'
140ddadd096 add '-56267E-1'    0 ->  '-5626.7'
141ddadd097 add '-56267E-0'    0 ->  '-56267'
142ddadd098 add '-5E-10'       0 ->  '-5E-10'
143ddadd099 add '-5E-7'        0 ->  '-5E-7'
144ddadd100 add '-5E-6'        0 ->  '-0.000005'
145ddadd101 add '-5E-5'        0 ->  '-0.00005'
146ddadd102 add '-5E-4'        0 ->  '-0.0005'
147ddadd103 add '-5E-1'        0 ->  '-0.5'
148ddadd104 add '-5E0'         0 ->  '-5'
149ddadd105 add '-5E1'         0 ->  '-50'
150ddadd106 add '-5E5'         0 ->  '-500000'
151ddadd107 add '-5E15'        0 ->  '-5000000000000000'
152ddadd108 add '-5E16'        0 ->  '-5.000000000000000E+16'  Rounded
153ddadd109 add '-5E17'        0 ->  '-5.000000000000000E+17'  Rounded
154ddadd110 add '-5E18'        0 ->  '-5.000000000000000E+18'  Rounded
155ddadd111 add '-5E100'       0 ->  '-5.000000000000000E+100' Rounded
156
157-- more RHS swaps
158ddadd113 add 0  '-56267E-10' ->  '-0.0000056267'
159ddadd114 add 0  '-56267E-6'  ->  '-0.056267'
160ddadd116 add 0  '-56267E-5'  ->  '-0.56267'
161ddadd117 add 0  '-56267E-4'  ->  '-5.6267'
162ddadd119 add 0  '-56267E-3'  ->  '-56.267'
163ddadd120 add 0  '-56267E-2'  ->  '-562.67'
164ddadd121 add 0  '-56267E-1'  ->  '-5626.7'
165ddadd122 add 0  '-56267E-0'  ->  '-56267'
166ddadd123 add 0  '-5E-10'     ->  '-5E-10'
167ddadd124 add 0  '-5E-7'      ->  '-5E-7'
168ddadd125 add 0  '-5E-6'      ->  '-0.000005'
169ddadd126 add 0  '-5E-5'      ->  '-0.00005'
170ddadd127 add 0  '-5E-4'      ->  '-0.0005'
171ddadd128 add 0  '-5E-1'      ->  '-0.5'
172ddadd129 add 0  '-5E0'       ->  '-5'
173ddadd130 add 0  '-5E1'       ->  '-50'
174ddadd131 add 0  '-5E5'       ->  '-500000'
175ddadd132 add 0  '-5E15'      ->  '-5000000000000000'
176ddadd133 add 0  '-5E16'      ->  '-5.000000000000000E+16'   Rounded
177ddadd134 add 0  '-5E17'      ->  '-5.000000000000000E+17'   Rounded
178ddadd135 add 0  '-5E18'      ->  '-5.000000000000000E+18'   Rounded
179ddadd136 add 0  '-5E100'     ->  '-5.000000000000000E+100'  Rounded
180
181-- related
182ddadd137 add  1  '0E-19'      ->  '1.000000000000000'  Rounded
183ddadd138 add -1  '0E-19'      ->  '-1.000000000000000' Rounded
184ddadd139 add '0E-19' 1        ->  '1.000000000000000'  Rounded
185ddadd140 add '0E-19' -1       ->  '-1.000000000000000' Rounded
186ddadd141 add 1E+11   0.0000   ->  '100000000000.0000'
187ddadd142 add 1E+11   0.00000  ->  '100000000000.0000'  Rounded
188ddadd143 add 0.000   1E+12    ->  '1000000000000.000'
189ddadd144 add 0.0000  1E+12    ->  '1000000000000.000'  Rounded
190
191-- [some of the next group are really constructor tests]
192ddadd146 add '00.0'  0       ->  '0.0'
193ddadd147 add '0.00'  0       ->  '0.00'
194ddadd148 add  0      '0.00'  ->  '0.00'
195ddadd149 add  0      '00.0'  ->  '0.0'
196ddadd150 add '00.0'  '0.00'  ->  '0.00'
197ddadd151 add '0.00'  '00.0'  ->  '0.00'
198ddadd152 add '3'     '.3'    ->  '3.3'
199ddadd153 add '3.'    '.3'    ->  '3.3'
200ddadd154 add '3.0'   '.3'    ->  '3.3'
201ddadd155 add '3.00'  '.3'    ->  '3.30'
202ddadd156 add '3'     '3'     ->  '6'
203ddadd157 add '3'     '+3'    ->  '6'
204ddadd158 add '3'     '-3'    ->  '0'
205ddadd159 add '0.3'   '-0.3'  ->  '0.0'
206ddadd160 add '0.03'  '-0.03' ->  '0.00'
207
208-- try borderline precision, with carries, etc.
209ddadd161 add '1E+12' '-1'    -> '999999999999'
210ddadd162 add '1E+12'  '1.11' -> '1000000000001.11'
211ddadd163 add '1.11'  '1E+12' -> '1000000000001.11'
212ddadd164 add '-1'    '1E+12' -> '999999999999'
213ddadd165 add '7E+12' '-1'    -> '6999999999999'
214ddadd166 add '7E+12'  '1.11' -> '7000000000001.11'
215ddadd167 add '1.11'  '7E+12' -> '7000000000001.11'
216ddadd168 add '-1'    '7E+12' -> '6999999999999'
217
218rounding: half_up
219--           1.234567890123456      1234567890123456      1 234567890123456
220ddadd170 add '4.444444444444444'  '0.5555555555555567' -> '5.000000000000001' Inexact Rounded
221ddadd171 add '4.444444444444444'  '0.5555555555555566' -> '5.000000000000001' Inexact Rounded
222ddadd172 add '4.444444444444444'  '0.5555555555555565' -> '5.000000000000001' Inexact Rounded
223ddadd173 add '4.444444444444444'  '0.5555555555555564' -> '5.000000000000000' Inexact Rounded
224ddadd174 add '4.444444444444444'  '0.5555555555555553' -> '4.999999999999999' Inexact Rounded
225ddadd175 add '4.444444444444444'  '0.5555555555555552' -> '4.999999999999999' Inexact Rounded
226ddadd176 add '4.444444444444444'  '0.5555555555555551' -> '4.999999999999999' Inexact Rounded
227ddadd177 add '4.444444444444444'  '0.5555555555555550' -> '4.999999999999999' Rounded
228ddadd178 add '4.444444444444444'  '0.5555555555555545' -> '4.999999999999999' Inexact Rounded
229ddadd179 add '4.444444444444444'  '0.5555555555555544' -> '4.999999999999998' Inexact Rounded
230ddadd180 add '4.444444444444444'  '0.5555555555555543' -> '4.999999999999998' Inexact Rounded
231ddadd181 add '4.444444444444444'  '0.5555555555555542' -> '4.999999999999998' Inexact Rounded
232ddadd182 add '4.444444444444444'  '0.5555555555555541' -> '4.999999999999998' Inexact Rounded
233ddadd183 add '4.444444444444444'  '0.5555555555555540' -> '4.999999999999998' Rounded
234
235-- and some more, including residue effects and different roundings
236rounding: half_up
237ddadd200 add '1234560123456789' 0             -> '1234560123456789'
238ddadd201 add '1234560123456789' 0.000000001   -> '1234560123456789' Inexact Rounded
239ddadd202 add '1234560123456789' 0.000001      -> '1234560123456789' Inexact Rounded
240ddadd203 add '1234560123456789' 0.1           -> '1234560123456789' Inexact Rounded
241ddadd204 add '1234560123456789' 0.4           -> '1234560123456789' Inexact Rounded
242ddadd205 add '1234560123456789' 0.49          -> '1234560123456789' Inexact Rounded
243ddadd206 add '1234560123456789' 0.499999      -> '1234560123456789' Inexact Rounded
244ddadd207 add '1234560123456789' 0.499999999   -> '1234560123456789' Inexact Rounded
245ddadd208 add '1234560123456789' 0.5           -> '1234560123456790' Inexact Rounded
246ddadd209 add '1234560123456789' 0.500000001   -> '1234560123456790' Inexact Rounded
247ddadd210 add '1234560123456789' 0.500001      -> '1234560123456790' Inexact Rounded
248ddadd211 add '1234560123456789' 0.51          -> '1234560123456790' Inexact Rounded
249ddadd212 add '1234560123456789' 0.6           -> '1234560123456790' Inexact Rounded
250ddadd213 add '1234560123456789' 0.9           -> '1234560123456790' Inexact Rounded
251ddadd214 add '1234560123456789' 0.99999       -> '1234560123456790' Inexact Rounded
252ddadd215 add '1234560123456789' 0.999999999   -> '1234560123456790' Inexact Rounded
253ddadd216 add '1234560123456789' 1             -> '1234560123456790'
254ddadd217 add '1234560123456789' 1.000000001   -> '1234560123456790' Inexact Rounded
255ddadd218 add '1234560123456789' 1.00001       -> '1234560123456790' Inexact Rounded
256ddadd219 add '1234560123456789' 1.1           -> '1234560123456790' Inexact Rounded
257
258rounding: half_even
259ddadd220 add '1234560123456789' 0             -> '1234560123456789'
260ddadd221 add '1234560123456789' 0.000000001   -> '1234560123456789' Inexact Rounded
261ddadd222 add '1234560123456789' 0.000001      -> '1234560123456789' Inexact Rounded
262ddadd223 add '1234560123456789' 0.1           -> '1234560123456789' Inexact Rounded
263ddadd224 add '1234560123456789' 0.4           -> '1234560123456789' Inexact Rounded
264ddadd225 add '1234560123456789' 0.49          -> '1234560123456789' Inexact Rounded
265ddadd226 add '1234560123456789' 0.499999      -> '1234560123456789' Inexact Rounded
266ddadd227 add '1234560123456789' 0.499999999   -> '1234560123456789' Inexact Rounded
267ddadd228 add '1234560123456789' 0.5           -> '1234560123456790' Inexact Rounded
268ddadd229 add '1234560123456789' 0.500000001   -> '1234560123456790' Inexact Rounded
269ddadd230 add '1234560123456789' 0.500001      -> '1234560123456790' Inexact Rounded
270ddadd231 add '1234560123456789' 0.51          -> '1234560123456790' Inexact Rounded
271ddadd232 add '1234560123456789' 0.6           -> '1234560123456790' Inexact Rounded
272ddadd233 add '1234560123456789' 0.9           -> '1234560123456790' Inexact Rounded
273ddadd234 add '1234560123456789' 0.99999       -> '1234560123456790' Inexact Rounded
274ddadd235 add '1234560123456789' 0.999999999   -> '1234560123456790' Inexact Rounded
275ddadd236 add '1234560123456789' 1             -> '1234560123456790'
276ddadd237 add '1234560123456789' 1.00000001    -> '1234560123456790' Inexact Rounded
277ddadd238 add '1234560123456789' 1.00001       -> '1234560123456790' Inexact Rounded
278ddadd239 add '1234560123456789' 1.1           -> '1234560123456790' Inexact Rounded
279-- critical few with even bottom digit...
280ddadd240 add '1234560123456788' 0.499999999   -> '1234560123456788' Inexact Rounded
281ddadd241 add '1234560123456788' 0.5           -> '1234560123456788' Inexact Rounded
282ddadd242 add '1234560123456788' 0.500000001   -> '1234560123456789' Inexact Rounded
283
284rounding: down
285ddadd250 add '1234560123456789' 0             -> '1234560123456789'
286ddadd251 add '1234560123456789' 0.000000001   -> '1234560123456789' Inexact Rounded
287ddadd252 add '1234560123456789' 0.000001      -> '1234560123456789' Inexact Rounded
288ddadd253 add '1234560123456789' 0.1           -> '1234560123456789' Inexact Rounded
289ddadd254 add '1234560123456789' 0.4           -> '1234560123456789' Inexact Rounded
290ddadd255 add '1234560123456789' 0.49          -> '1234560123456789' Inexact Rounded
291ddadd256 add '1234560123456789' 0.499999      -> '1234560123456789' Inexact Rounded
292ddadd257 add '1234560123456789' 0.499999999   -> '1234560123456789' Inexact Rounded
293ddadd258 add '1234560123456789' 0.5           -> '1234560123456789' Inexact Rounded
294ddadd259 add '1234560123456789' 0.500000001   -> '1234560123456789' Inexact Rounded
295ddadd260 add '1234560123456789' 0.500001      -> '1234560123456789' Inexact Rounded
296ddadd261 add '1234560123456789' 0.51          -> '1234560123456789' Inexact Rounded
297ddadd262 add '1234560123456789' 0.6           -> '1234560123456789' Inexact Rounded
298ddadd263 add '1234560123456789' 0.9           -> '1234560123456789' Inexact Rounded
299ddadd264 add '1234560123456789' 0.99999       -> '1234560123456789' Inexact Rounded
300ddadd265 add '1234560123456789' 0.999999999   -> '1234560123456789' Inexact Rounded
301ddadd266 add '1234560123456789' 1             -> '1234560123456790'
302ddadd267 add '1234560123456789' 1.00000001    -> '1234560123456790' Inexact Rounded
303ddadd268 add '1234560123456789' 1.00001       -> '1234560123456790' Inexact Rounded
304ddadd269 add '1234560123456789' 1.1           -> '1234560123456790' Inexact Rounded
305
306-- 1 in last place tests
307rounding: half_up
308ddadd301 add  -1   1      ->   0
309ddadd302 add   0   1      ->   1
310ddadd303 add   1   1      ->   2
311ddadd304 add  12   1      ->  13
312ddadd305 add  98   1      ->  99
313ddadd306 add  99   1      -> 100
314ddadd307 add 100   1      -> 101
315ddadd308 add 101   1      -> 102
316ddadd309 add  -1  -1      ->  -2
317ddadd310 add   0  -1      ->  -1
318ddadd311 add   1  -1      ->   0
319ddadd312 add  12  -1      ->  11
320ddadd313 add  98  -1      ->  97
321ddadd314 add  99  -1      ->  98
322ddadd315 add 100  -1      ->  99
323ddadd316 add 101  -1      -> 100
324
325ddadd321 add -0.01  0.01    ->  0.00
326ddadd322 add  0.00  0.01    ->  0.01
327ddadd323 add  0.01  0.01    ->  0.02
328ddadd324 add  0.12  0.01    ->  0.13
329ddadd325 add  0.98  0.01    ->  0.99
330ddadd326 add  0.99  0.01    ->  1.00
331ddadd327 add  1.00  0.01    ->  1.01
332ddadd328 add  1.01  0.01    ->  1.02
333ddadd329 add -0.01 -0.01    -> -0.02
334ddadd330 add  0.00 -0.01    -> -0.01
335ddadd331 add  0.01 -0.01    ->  0.00
336ddadd332 add  0.12 -0.01    ->  0.11
337ddadd333 add  0.98 -0.01    ->  0.97
338ddadd334 add  0.99 -0.01    ->  0.98
339ddadd335 add  1.00 -0.01    ->  0.99
340ddadd336 add  1.01 -0.01    ->  1.00
341
342-- some more cases where adding 0 affects the coefficient
343ddadd340 add 1E+3    0    ->         1000
344ddadd341 add 1E+15   0    ->    1000000000000000
345ddadd342 add 1E+16   0    ->   1.000000000000000E+16  Rounded
346ddadd343 add 1E+20   0    ->   1.000000000000000E+20  Rounded
347-- which simply follow from these cases ...
348ddadd344 add 1E+3    1    ->         1001
349ddadd345 add 1E+15   1    ->    1000000000000001
350ddadd346 add 1E+16   1    ->   1.000000000000000E+16  Inexact Rounded
351ddadd347 add 1E+20   1    ->   1.000000000000000E+20  Inexact Rounded
352ddadd348 add 1E+3    7    ->         1007
353ddadd349 add 1E+15   7    ->    1000000000000007
354ddadd350 add 1E+16   7    ->   1.000000000000001E+16  Inexact Rounded
355ddadd351 add 1E+20   7    ->   1.000000000000000E+20  Inexact Rounded
356
357-- tryzeros cases
358rounding:    half_up
359ddadd360  add 0E+50 10000E+1  -> 1.0000E+5
360ddadd361  add 0E-50 10000E+1  -> 100000.0000000000 Rounded
361ddadd362  add 10000E+1 0E-50  -> 100000.0000000000 Rounded
362ddadd363  add 10000E+1 10000E-50  -> 100000.0000000000 Rounded Inexact
363ddadd364  add 9.999999999999999E+384 -9.999999999999999E+384 -> 0E+369
364
365-- a curiosity from JSR 13 testing
366rounding:    half_down
367ddadd370 add  999999999999999 815 -> 1000000000000814
368ddadd371 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
369rounding:    half_up
370ddadd372 add  999999999999999 815 -> 1000000000000814
371ddadd373 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
372rounding:    half_even
373ddadd374 add  999999999999999 815 -> 1000000000000814
374ddadd375 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
375
376-- operands folded
377ddadd380 add   1E+384  1E+384  ->  2.000000000000000E+384  Clamped
378ddadd381 add   1E+380  1E+380  ->  2.00000000000E+380      Clamped
379ddadd382 add   1E+376  1E+376  ->  2.0000000E+376          Clamped
380ddadd383 add   1E+372  1E+372  ->  2.000E+372              Clamped
381ddadd384 add   1E+370  1E+370  ->  2.0E+370                Clamped
382ddadd385 add   1E+369  1E+369  ->  2E+369
383ddadd386 add   1E+368  1E+368  ->  2E+368
384
385-- ulp replacement tests
386ddadd400 add   1   77e-14      ->  1.00000000000077
387ddadd401 add   1   77e-15      ->  1.000000000000077
388ddadd402 add   1   77e-16      ->  1.000000000000008 Inexact Rounded
389ddadd403 add   1   77e-17      ->  1.000000000000001 Inexact Rounded
390ddadd404 add   1   77e-18      ->  1.000000000000000 Inexact Rounded
391ddadd405 add   1   77e-19      ->  1.000000000000000 Inexact Rounded
392ddadd406 add   1   77e-299     ->  1.000000000000000 Inexact Rounded
393
394ddadd410 add  10   77e-14      ->  10.00000000000077
395ddadd411 add  10   77e-15      ->  10.00000000000008 Inexact Rounded
396ddadd412 add  10   77e-16      ->  10.00000000000001 Inexact Rounded
397ddadd413 add  10   77e-17      ->  10.00000000000000 Inexact Rounded
398ddadd414 add  10   77e-18      ->  10.00000000000000 Inexact Rounded
399ddadd415 add  10   77e-19      ->  10.00000000000000 Inexact Rounded
400ddadd416 add  10   77e-299     ->  10.00000000000000 Inexact Rounded
401
402ddadd420 add  77e-14       1   ->  1.00000000000077
403ddadd421 add  77e-15       1   ->  1.000000000000077
404ddadd422 add  77e-16       1   ->  1.000000000000008 Inexact Rounded
405ddadd423 add  77e-17       1   ->  1.000000000000001 Inexact Rounded
406ddadd424 add  77e-18       1   ->  1.000000000000000 Inexact Rounded
407ddadd425 add  77e-19       1   ->  1.000000000000000 Inexact Rounded
408ddadd426 add  77e-299      1   ->  1.000000000000000 Inexact Rounded
409
410ddadd430 add  77e-14      10   ->  10.00000000000077
411ddadd431 add  77e-15      10   ->  10.00000000000008 Inexact Rounded
412ddadd432 add  77e-16      10   ->  10.00000000000001 Inexact Rounded
413ddadd433 add  77e-17      10   ->  10.00000000000000 Inexact Rounded
414ddadd434 add  77e-18      10   ->  10.00000000000000 Inexact Rounded
415ddadd435 add  77e-19      10   ->  10.00000000000000 Inexact Rounded
416ddadd436 add  77e-299     10   ->  10.00000000000000 Inexact Rounded
417
418-- fastpath boundary (more in dqadd)
419--            1234567890123456
420ddadd539 add '4444444444444444'  '3333333333333333' -> '7777777777777777'
421ddadd540 add '4444444444444444'  '4444444444444444' -> '8888888888888888'
422ddadd541 add '4444444444444444'  '5555555555555555' -> '9999999999999999'
423ddadd542 add '3333333333333333'  '4444444444444444' -> '7777777777777777'
424ddadd543 add '4444444444444444'  '4444444444444444' -> '8888888888888888'
425ddadd544 add '5555555555555555'  '4444444444444444' -> '9999999999999999'
426ddadd545 add '3000004000000000'  '3000000000000040' -> '6000004000000040'
427ddadd546 add '3000000400000000'  '4000000000000400' -> '7000000400000400'
428ddadd547 add '3000000040000000'  '5000000000004000' -> '8000000040004000'
429ddadd548 add '4000000004000000'  '3000000000040000' -> '7000000004040000'
430ddadd549 add '4000000000400000'  '4000000000400000' -> '8000000000800000'
431ddadd550 add '4000000000040000'  '5000000004000000' -> '9000000004040000'
432ddadd551 add '5000000000004000'  '3000000040000000' -> '8000000040004000'
433ddadd552 add '5000000000000400'  '4000000400000000' -> '9000000400000400'
434ddadd553 add '5000000000000040'  '5000004000000000' -> 1.000000400000004E+16 Rounded
435-- check propagation
436ddadd554 add '8999999999999999'  '0000000000000001' -> 9000000000000000
437ddadd555 add '0000000000000001'  '8999999999999999' -> 9000000000000000
438ddadd556 add '0999999999999999'  '0000000000000001' -> 1000000000000000
439ddadd557 add '0000000000000001'  '0999999999999999' -> 1000000000000000
440ddadd558 add '4444444444444444'  '4555555555555556' -> 9000000000000000
441ddadd559 add '4555555555555556'  '4444444444444444' -> 9000000000000000
442
443-- negative ulps
444ddadd6440 add   1   -77e-14      ->  0.99999999999923
445ddadd6441 add   1   -77e-15      ->  0.999999999999923
446ddadd6442 add   1   -77e-16      ->  0.9999999999999923
447ddadd6443 add   1   -77e-17      ->  0.9999999999999992 Inexact Rounded
448ddadd6444 add   1   -77e-18      ->  0.9999999999999999 Inexact Rounded
449ddadd6445 add   1   -77e-19      ->  1.000000000000000 Inexact Rounded
450ddadd6446 add   1   -77e-99      ->  1.000000000000000 Inexact Rounded
451
452ddadd6450 add  10   -77e-14      ->   9.99999999999923
453ddadd6451 add  10   -77e-15      ->   9.999999999999923
454ddadd6452 add  10   -77e-16      ->   9.999999999999992 Inexact Rounded
455ddadd6453 add  10   -77e-17      ->   9.999999999999999 Inexact Rounded
456ddadd6454 add  10   -77e-18      ->  10.00000000000000 Inexact Rounded
457ddadd6455 add  10   -77e-19      ->  10.00000000000000 Inexact Rounded
458ddadd6456 add  10   -77e-99      ->  10.00000000000000 Inexact Rounded
459
460ddadd6460 add  -77e-14       1   ->  0.99999999999923
461ddadd6461 add  -77e-15       1   ->  0.999999999999923
462ddadd6462 add  -77e-16       1   ->  0.9999999999999923
463ddadd6463 add  -77e-17       1   ->  0.9999999999999992 Inexact Rounded
464ddadd6464 add  -77e-18       1   ->  0.9999999999999999 Inexact Rounded
465ddadd6465 add  -77e-19       1   ->  1.000000000000000 Inexact Rounded
466ddadd6466 add  -77e-99       1   ->  1.000000000000000 Inexact Rounded
467
468ddadd6470 add  -77e-14      10   ->   9.99999999999923
469ddadd6471 add  -77e-15      10   ->   9.999999999999923
470ddadd6472 add  -77e-16      10   ->   9.999999999999992 Inexact Rounded
471ddadd6473 add  -77e-17      10   ->   9.999999999999999 Inexact Rounded
472ddadd6474 add  -77e-18      10   ->  10.00000000000000 Inexact Rounded
473ddadd6475 add  -77e-19      10   ->  10.00000000000000 Inexact Rounded
474ddadd6476 add  -77e-99      10   ->  10.00000000000000 Inexact Rounded
475
476-- negative ulps
477ddadd6480 add  -1    77e-14      ->  -0.99999999999923
478ddadd6481 add  -1    77e-15      ->  -0.999999999999923
479ddadd6482 add  -1    77e-16      ->  -0.9999999999999923
480ddadd6483 add  -1    77e-17      ->  -0.9999999999999992 Inexact Rounded
481ddadd6484 add  -1    77e-18      ->  -0.9999999999999999 Inexact Rounded
482ddadd6485 add  -1    77e-19      ->  -1.000000000000000 Inexact Rounded
483ddadd6486 add  -1    77e-99      ->  -1.000000000000000 Inexact Rounded
484
485ddadd6490 add -10    77e-14      ->   -9.99999999999923
486ddadd6491 add -10    77e-15      ->   -9.999999999999923
487ddadd6492 add -10    77e-16      ->   -9.999999999999992 Inexact Rounded
488ddadd6493 add -10    77e-17      ->   -9.999999999999999 Inexact Rounded
489ddadd6494 add -10    77e-18      ->  -10.00000000000000 Inexact Rounded
490ddadd6495 add -10    77e-19      ->  -10.00000000000000 Inexact Rounded
491ddadd6496 add -10    77e-99      ->  -10.00000000000000 Inexact Rounded
492
493ddadd6500 add   77e-14      -1   ->  -0.99999999999923
494ddadd6501 add   77e-15      -1   ->  -0.999999999999923
495ddadd6502 add   77e-16      -1   ->  -0.9999999999999923
496ddadd6503 add   77e-17      -1   ->  -0.9999999999999992 Inexact Rounded
497ddadd6504 add   77e-18      -1   ->  -0.9999999999999999 Inexact Rounded
498ddadd6505 add   77e-19      -1   ->  -1.000000000000000 Inexact Rounded
499ddadd6506 add   77e-99      -1   ->  -1.000000000000000 Inexact Rounded
500
501ddadd6510 add   77e-14      -10  ->   -9.99999999999923
502ddadd6511 add   77e-15      -10  ->   -9.999999999999923
503ddadd6512 add   77e-16      -10  ->   -9.999999999999992 Inexact Rounded
504ddadd6513 add   77e-17      -10  ->   -9.999999999999999 Inexact Rounded
505ddadd6514 add   77e-18      -10  ->  -10.00000000000000 Inexact Rounded
506ddadd6515 add   77e-19      -10  ->  -10.00000000000000 Inexact Rounded
507ddadd6516 add   77e-99      -10  ->  -10.00000000000000 Inexact Rounded
508
509-- and some more residue effects and different roundings
510rounding: half_up
511ddadd6540 add '6543210123456789' 0             -> '6543210123456789'
512ddadd6541 add '6543210123456789' 0.000000001   -> '6543210123456789' Inexact Rounded
513ddadd6542 add '6543210123456789' 0.000001      -> '6543210123456789' Inexact Rounded
514ddadd6543 add '6543210123456789' 0.1           -> '6543210123456789' Inexact Rounded
515ddadd6544 add '6543210123456789' 0.4           -> '6543210123456789' Inexact Rounded
516ddadd6545 add '6543210123456789' 0.49          -> '6543210123456789' Inexact Rounded
517ddadd6546 add '6543210123456789' 0.499999      -> '6543210123456789' Inexact Rounded
518ddadd6547 add '6543210123456789' 0.499999999   -> '6543210123456789' Inexact Rounded
519ddadd6548 add '6543210123456789' 0.5           -> '6543210123456790' Inexact Rounded
520ddadd6549 add '6543210123456789' 0.500000001   -> '6543210123456790' Inexact Rounded
521ddadd6550 add '6543210123456789' 0.500001      -> '6543210123456790' Inexact Rounded
522ddadd6551 add '6543210123456789' 0.51          -> '6543210123456790' Inexact Rounded
523ddadd6552 add '6543210123456789' 0.6           -> '6543210123456790' Inexact Rounded
524ddadd6553 add '6543210123456789' 0.9           -> '6543210123456790' Inexact Rounded
525ddadd6554 add '6543210123456789' 0.99999       -> '6543210123456790' Inexact Rounded
526ddadd6555 add '6543210123456789' 0.999999999   -> '6543210123456790' Inexact Rounded
527ddadd6556 add '6543210123456789' 1             -> '6543210123456790'
528ddadd6557 add '6543210123456789' 1.000000001   -> '6543210123456790' Inexact Rounded
529ddadd6558 add '6543210123456789' 1.00001       -> '6543210123456790' Inexact Rounded
530ddadd6559 add '6543210123456789' 1.1           -> '6543210123456790' Inexact Rounded
531
532rounding: half_even
533ddadd6560 add '6543210123456789' 0             -> '6543210123456789'
534ddadd6561 add '6543210123456789' 0.000000001   -> '6543210123456789' Inexact Rounded
535ddadd6562 add '6543210123456789' 0.000001      -> '6543210123456789' Inexact Rounded
536ddadd6563 add '6543210123456789' 0.1           -> '6543210123456789' Inexact Rounded
537ddadd6564 add '6543210123456789' 0.4           -> '6543210123456789' Inexact Rounded
538ddadd6565 add '6543210123456789' 0.49          -> '6543210123456789' Inexact Rounded
539ddadd6566 add '6543210123456789' 0.499999      -> '6543210123456789' Inexact Rounded
540ddadd6567 add '6543210123456789' 0.499999999   -> '6543210123456789' Inexact Rounded
541ddadd6568 add '6543210123456789' 0.5           -> '6543210123456790' Inexact Rounded
542ddadd6569 add '6543210123456789' 0.500000001   -> '6543210123456790' Inexact Rounded
543ddadd6570 add '6543210123456789' 0.500001      -> '6543210123456790' Inexact Rounded
544ddadd6571 add '6543210123456789' 0.51          -> '6543210123456790' Inexact Rounded
545ddadd6572 add '6543210123456789' 0.6           -> '6543210123456790' Inexact Rounded
546ddadd6573 add '6543210123456789' 0.9           -> '6543210123456790' Inexact Rounded
547ddadd6574 add '6543210123456789' 0.99999       -> '6543210123456790' Inexact Rounded
548ddadd6575 add '6543210123456789' 0.999999999   -> '6543210123456790' Inexact Rounded
549ddadd6576 add '6543210123456789' 1             -> '6543210123456790'
550ddadd6577 add '6543210123456789' 1.00000001    -> '6543210123456790' Inexact Rounded
551ddadd6578 add '6543210123456789' 1.00001       -> '6543210123456790' Inexact Rounded
552ddadd6579 add '6543210123456789' 1.1           -> '6543210123456790' Inexact Rounded
553
554-- critical few with even bottom digit...
555ddadd7540 add '6543210123456788' 0.499999999   -> '6543210123456788' Inexact Rounded
556ddadd7541 add '6543210123456788' 0.5           -> '6543210123456788' Inexact Rounded
557ddadd7542 add '6543210123456788' 0.500000001   -> '6543210123456789' Inexact Rounded
558
559rounding: down
560ddadd7550 add '6543210123456789' 0             -> '6543210123456789'
561ddadd7551 add '6543210123456789' 0.000000001   -> '6543210123456789' Inexact Rounded
562ddadd7552 add '6543210123456789' 0.000001      -> '6543210123456789' Inexact Rounded
563ddadd7553 add '6543210123456789' 0.1           -> '6543210123456789' Inexact Rounded
564ddadd7554 add '6543210123456789' 0.4           -> '6543210123456789' Inexact Rounded
565ddadd7555 add '6543210123456789' 0.49          -> '6543210123456789' Inexact Rounded
566ddadd7556 add '6543210123456789' 0.499999      -> '6543210123456789' Inexact Rounded
567ddadd7557 add '6543210123456789' 0.499999999   -> '6543210123456789' Inexact Rounded
568ddadd7558 add '6543210123456789' 0.5           -> '6543210123456789' Inexact Rounded
569ddadd7559 add '6543210123456789' 0.500000001   -> '6543210123456789' Inexact Rounded
570ddadd7560 add '6543210123456789' 0.500001      -> '6543210123456789' Inexact Rounded
571ddadd7561 add '6543210123456789' 0.51          -> '6543210123456789' Inexact Rounded
572ddadd7562 add '6543210123456789' 0.6           -> '6543210123456789' Inexact Rounded
573ddadd7563 add '6543210123456789' 0.9           -> '6543210123456789' Inexact Rounded
574ddadd7564 add '6543210123456789' 0.99999       -> '6543210123456789' Inexact Rounded
575ddadd7565 add '6543210123456789' 0.999999999   -> '6543210123456789' Inexact Rounded
576ddadd7566 add '6543210123456789' 1             -> '6543210123456790'
577ddadd7567 add '6543210123456789' 1.00000001    -> '6543210123456790' Inexact Rounded
578ddadd7568 add '6543210123456789' 1.00001       -> '6543210123456790' Inexact Rounded
579ddadd7569 add '6543210123456789' 1.1           -> '6543210123456790' Inexact Rounded
580
581-- verify a query
582rounding:     down
583ddadd7661 add 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
584ddadd7662 add      0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
585ddadd7663 add 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
586ddadd7664 add      0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
587
588-- more zeros, etc.
589rounding: half_even
590
591ddadd7701 add 5.00 1.00E-3 -> 5.00100
592ddadd7702 add 00.00 0.000  -> 0.000
593ddadd7703 add 00.00 0E-3   -> 0.000
594ddadd7704 add 0E-3  00.00  -> 0.000
595
596ddadd7710 add 0E+3  00.00  -> 0.00
597ddadd7711 add 0E+3  00.0   -> 0.0
598ddadd7712 add 0E+3  00.    -> 0
599ddadd7713 add 0E+3  00.E+1 -> 0E+1
600ddadd7714 add 0E+3  00.E+2 -> 0E+2
601ddadd7715 add 0E+3  00.E+3 -> 0E+3
602ddadd7716 add 0E+3  00.E+4 -> 0E+3
603ddadd7717 add 0E+3  00.E+5 -> 0E+3
604ddadd7718 add 0E+3  -00.0   -> 0.0
605ddadd7719 add 0E+3  -00.    -> 0
606ddadd7731 add 0E+3  -00.E+1 -> 0E+1
607
608ddadd7720 add 00.00  0E+3  -> 0.00
609ddadd7721 add 00.0   0E+3  -> 0.0
610ddadd7722 add 00.    0E+3  -> 0
611ddadd7723 add 00.E+1 0E+3  -> 0E+1
612ddadd7724 add 00.E+2 0E+3  -> 0E+2
613ddadd7725 add 00.E+3 0E+3  -> 0E+3
614ddadd7726 add 00.E+4 0E+3  -> 0E+3
615ddadd7727 add 00.E+5 0E+3  -> 0E+3
616ddadd7728 add -00.00 0E+3  -> 0.00
617ddadd7729 add -00.0  0E+3  -> 0.0
618ddadd7730 add -00.   0E+3  -> 0
619
620ddadd7732 add  0     0     ->  0
621ddadd7733 add  0    -0     ->  0
622ddadd7734 add -0     0     ->  0
623ddadd7735 add -0    -0     -> -0     -- IEEE 854 special case
624
625ddadd7736 add  1    -1     ->  0
626ddadd7737 add -1    -1     -> -2
627ddadd7738 add  1     1     ->  2
628ddadd7739 add -1     1     ->  0
629
630ddadd7741 add  0    -1     -> -1
631ddadd7742 add -0    -1     -> -1
632ddadd7743 add  0     1     ->  1
633ddadd7744 add -0     1     ->  1
634ddadd7745 add -1     0     -> -1
635ddadd7746 add -1    -0     -> -1
636ddadd7747 add  1     0     ->  1
637ddadd7748 add  1    -0     ->  1
638
639ddadd7751 add  0.0  -1     -> -1.0
640ddadd7752 add -0.0  -1     -> -1.0
641ddadd7753 add  0.0   1     ->  1.0
642ddadd7754 add -0.0   1     ->  1.0
643ddadd7755 add -1.0   0     -> -1.0
644ddadd7756 add -1.0  -0     -> -1.0
645ddadd7757 add  1.0   0     ->  1.0
646ddadd7758 add  1.0  -0     ->  1.0
647
648ddadd7761 add  0    -1.0   -> -1.0
649ddadd7762 add -0    -1.0   -> -1.0
650ddadd7763 add  0     1.0   ->  1.0
651ddadd7764 add -0     1.0   ->  1.0
652ddadd7765 add -1     0.0   -> -1.0
653ddadd7766 add -1    -0.0   -> -1.0
654ddadd7767 add  1     0.0   ->  1.0
655ddadd7768 add  1    -0.0   ->  1.0
656
657ddadd7771 add  0.0  -1.0   -> -1.0
658ddadd7772 add -0.0  -1.0   -> -1.0
659ddadd7773 add  0.0   1.0   ->  1.0
660ddadd7774 add -0.0   1.0   ->  1.0
661ddadd7775 add -1.0   0.0   -> -1.0
662ddadd7776 add -1.0  -0.0   -> -1.0
663ddadd7777 add  1.0   0.0   ->  1.0
664ddadd7778 add  1.0  -0.0   ->  1.0
665
666-- Specials
667ddadd7780 add -Inf  -Inf   -> -Infinity
668ddadd7781 add -Inf  -1000  -> -Infinity
669ddadd7782 add -Inf  -1     -> -Infinity
670ddadd7783 add -Inf  -0     -> -Infinity
671ddadd7784 add -Inf   0     -> -Infinity
672ddadd7785 add -Inf   1     -> -Infinity
673ddadd7786 add -Inf   1000  -> -Infinity
674ddadd7787 add -1000 -Inf   -> -Infinity
675ddadd7788 add -Inf  -Inf   -> -Infinity
676ddadd7789 add -1    -Inf   -> -Infinity
677ddadd7790 add -0    -Inf   -> -Infinity
678ddadd7791 add  0    -Inf   -> -Infinity
679ddadd7792 add  1    -Inf   -> -Infinity
680ddadd7793 add  1000 -Inf   -> -Infinity
681ddadd7794 add  Inf  -Inf   ->  NaN  Invalid_operation
682
683ddadd7800 add  Inf  -Inf   ->  NaN  Invalid_operation
684ddadd7801 add  Inf  -1000  ->  Infinity
685ddadd7802 add  Inf  -1     ->  Infinity
686ddadd7803 add  Inf  -0     ->  Infinity
687ddadd7804 add  Inf   0     ->  Infinity
688ddadd7805 add  Inf   1     ->  Infinity
689ddadd7806 add  Inf   1000  ->  Infinity
690ddadd7807 add  Inf   Inf   ->  Infinity
691ddadd7808 add -1000  Inf   ->  Infinity
692ddadd7809 add -Inf   Inf   ->  NaN  Invalid_operation
693ddadd7810 add -1     Inf   ->  Infinity
694ddadd7811 add -0     Inf   ->  Infinity
695ddadd7812 add  0     Inf   ->  Infinity
696ddadd7813 add  1     Inf   ->  Infinity
697ddadd7814 add  1000  Inf   ->  Infinity
698ddadd7815 add  Inf   Inf   ->  Infinity
699
700ddadd7821 add  NaN -Inf    ->  NaN
701ddadd7822 add  NaN -1000   ->  NaN
702ddadd7823 add  NaN -1      ->  NaN
703ddadd7824 add  NaN -0      ->  NaN
704ddadd7825 add  NaN  0      ->  NaN
705ddadd7826 add  NaN  1      ->  NaN
706ddadd7827 add  NaN  1000   ->  NaN
707ddadd7828 add  NaN  Inf    ->  NaN
708ddadd7829 add  NaN  NaN    ->  NaN
709ddadd7830 add -Inf  NaN    ->  NaN
710ddadd7831 add -1000 NaN    ->  NaN
711ddadd7832 add -1    NaN    ->  NaN
712ddadd7833 add -0    NaN    ->  NaN
713ddadd7834 add  0    NaN    ->  NaN
714ddadd7835 add  1    NaN    ->  NaN
715ddadd7836 add  1000 NaN    ->  NaN
716ddadd7837 add  Inf  NaN    ->  NaN
717
718ddadd7841 add  sNaN -Inf   ->  NaN  Invalid_operation
719ddadd7842 add  sNaN -1000  ->  NaN  Invalid_operation
720ddadd7843 add  sNaN -1     ->  NaN  Invalid_operation
721ddadd7844 add  sNaN -0     ->  NaN  Invalid_operation
722ddadd7845 add  sNaN  0     ->  NaN  Invalid_operation
723ddadd7846 add  sNaN  1     ->  NaN  Invalid_operation
724ddadd7847 add  sNaN  1000  ->  NaN  Invalid_operation
725ddadd7848 add  sNaN  NaN   ->  NaN  Invalid_operation
726ddadd7849 add  sNaN sNaN   ->  NaN  Invalid_operation
727ddadd7850 add  NaN  sNaN   ->  NaN  Invalid_operation
728ddadd7851 add -Inf  sNaN   ->  NaN  Invalid_operation
729ddadd7852 add -1000 sNaN   ->  NaN  Invalid_operation
730ddadd7853 add -1    sNaN   ->  NaN  Invalid_operation
731ddadd7854 add -0    sNaN   ->  NaN  Invalid_operation
732ddadd7855 add  0    sNaN   ->  NaN  Invalid_operation
733ddadd7856 add  1    sNaN   ->  NaN  Invalid_operation
734ddadd7857 add  1000 sNaN   ->  NaN  Invalid_operation
735ddadd7858 add  Inf  sNaN   ->  NaN  Invalid_operation
736ddadd7859 add  NaN  sNaN   ->  NaN  Invalid_operation
737
738-- propagating NaNs
739ddadd7861 add  NaN1   -Inf    ->  NaN1
740ddadd7862 add +NaN2   -1000   ->  NaN2
741ddadd7863 add  NaN3    1000   ->  NaN3
742ddadd7864 add  NaN4    Inf    ->  NaN4
743ddadd7865 add  NaN5   +NaN6   ->  NaN5
744ddadd7866 add -Inf     NaN7   ->  NaN7
745ddadd7867 add -1000    NaN8   ->  NaN8
746ddadd7868 add  1000    NaN9   ->  NaN9
747ddadd7869 add  Inf    +NaN10  ->  NaN10
748ddadd7871 add  sNaN11  -Inf   ->  NaN11  Invalid_operation
749ddadd7872 add  sNaN12  -1000  ->  NaN12  Invalid_operation
750ddadd7873 add  sNaN13   1000  ->  NaN13  Invalid_operation
751ddadd7874 add  sNaN14   NaN17 ->  NaN14  Invalid_operation
752ddadd7875 add  sNaN15  sNaN18 ->  NaN15  Invalid_operation
753ddadd7876 add  NaN16   sNaN19 ->  NaN19  Invalid_operation
754ddadd7877 add -Inf    +sNaN20 ->  NaN20  Invalid_operation
755ddadd7878 add -1000    sNaN21 ->  NaN21  Invalid_operation
756ddadd7879 add  1000    sNaN22 ->  NaN22  Invalid_operation
757ddadd7880 add  Inf     sNaN23 ->  NaN23  Invalid_operation
758ddadd7881 add +NaN25  +sNaN24 ->  NaN24  Invalid_operation
759ddadd7882 add -NaN26    NaN28 -> -NaN26
760ddadd7883 add -sNaN27  sNaN29 -> -NaN27  Invalid_operation
761ddadd7884 add  1000    -NaN30 -> -NaN30
762ddadd7885 add  1000   -sNaN31 -> -NaN31  Invalid_operation
763
764-- Here we explore near the boundary of rounding a subnormal to Nmin
765ddadd7575 add  1E-383 -1E-398 ->  9.99999999999999E-384  Subnormal
766ddadd7576 add -1E-383 +1E-398 -> -9.99999999999999E-384  Subnormal
767
768-- and another curious case
769ddadd7577 add 7.000000000000E-385 -1.00000E-391 -> 6.999999000000E-385 Subnormal
770
771-- check overflow edge case
772--               1234567890123456
773ddadd7972 apply   9.999999999999999E+384         -> 9.999999999999999E+384
774ddadd7973 add     9.999999999999999E+384  1      -> 9.999999999999999E+384 Inexact Rounded
775ddadd7974 add      9999999999999999E+369  1      -> 9.999999999999999E+384 Inexact Rounded
776ddadd7975 add      9999999999999999E+369  1E+369  -> Infinity Overflow Inexact Rounded
777ddadd7976 add      9999999999999999E+369  9E+368  -> Infinity Overflow Inexact Rounded
778ddadd7977 add      9999999999999999E+369  8E+368  -> Infinity Overflow Inexact Rounded
779ddadd7978 add      9999999999999999E+369  7E+368  -> Infinity Overflow Inexact Rounded
780ddadd7979 add      9999999999999999E+369  6E+368  -> Infinity Overflow Inexact Rounded
781ddadd7980 add      9999999999999999E+369  5E+368  -> Infinity Overflow Inexact Rounded
782ddadd7981 add      9999999999999999E+369  4E+368  -> 9.999999999999999E+384 Inexact Rounded
783ddadd7982 add      9999999999999999E+369  3E+368  -> 9.999999999999999E+384 Inexact Rounded
784ddadd7983 add      9999999999999999E+369  2E+368  -> 9.999999999999999E+384 Inexact Rounded
785ddadd7984 add      9999999999999999E+369  1E+368  -> 9.999999999999999E+384 Inexact Rounded
786
787ddadd7985 apply  -9.999999999999999E+384         -> -9.999999999999999E+384
788ddadd7986 add    -9.999999999999999E+384 -1      -> -9.999999999999999E+384 Inexact Rounded
789ddadd7987 add     -9999999999999999E+369 -1      -> -9.999999999999999E+384 Inexact Rounded
790ddadd7988 add     -9999999999999999E+369 -1E+369  -> -Infinity Overflow Inexact Rounded
791ddadd7989 add     -9999999999999999E+369 -9E+368  -> -Infinity Overflow Inexact Rounded
792ddadd7990 add     -9999999999999999E+369 -8E+368  -> -Infinity Overflow Inexact Rounded
793ddadd7991 add     -9999999999999999E+369 -7E+368  -> -Infinity Overflow Inexact Rounded
794ddadd7992 add     -9999999999999999E+369 -6E+368  -> -Infinity Overflow Inexact Rounded
795ddadd7993 add     -9999999999999999E+369 -5E+368  -> -Infinity Overflow Inexact Rounded
796ddadd7994 add     -9999999999999999E+369 -4E+368  -> -9.999999999999999E+384 Inexact Rounded
797ddadd7995 add     -9999999999999999E+369 -3E+368  -> -9.999999999999999E+384 Inexact Rounded
798ddadd7996 add     -9999999999999999E+369 -2E+368  -> -9.999999999999999E+384 Inexact Rounded
799ddadd7997 add     -9999999999999999E+369 -1E+368  -> -9.999999999999999E+384 Inexact Rounded
800
801-- And for round down full and subnormal results
802rounding:     down
803ddadd71100 add 1e+2 -1e-383    -> 99.99999999999999 Rounded Inexact
804ddadd71101 add 1e+1 -1e-383    -> 9.999999999999999  Rounded Inexact
805ddadd71103 add   +1 -1e-383    -> 0.9999999999999999  Rounded Inexact
806ddadd71104 add 1e-1 -1e-383    -> 0.09999999999999999  Rounded Inexact
807ddadd71105 add 1e-2 -1e-383    -> 0.009999999999999999  Rounded Inexact
808ddadd71106 add 1e-3 -1e-383    -> 0.0009999999999999999  Rounded Inexact
809ddadd71107 add 1e-4 -1e-383    -> 0.00009999999999999999  Rounded Inexact
810ddadd71108 add 1e-5 -1e-383    -> 0.000009999999999999999  Rounded Inexact
811ddadd71109 add 1e-6 -1e-383    -> 9.999999999999999E-7  Rounded Inexact
812
813rounding:     ceiling
814ddadd71110 add -1e+2 +1e-383   -> -99.99999999999999 Rounded Inexact
815ddadd71111 add -1e+1 +1e-383   -> -9.999999999999999  Rounded Inexact
816ddadd71113 add    -1 +1e-383   -> -0.9999999999999999  Rounded Inexact
817ddadd71114 add -1e-1 +1e-383   -> -0.09999999999999999  Rounded Inexact
818ddadd71115 add -1e-2 +1e-383   -> -0.009999999999999999  Rounded Inexact
819ddadd71116 add -1e-3 +1e-383   -> -0.0009999999999999999  Rounded Inexact
820ddadd71117 add -1e-4 +1e-383   -> -0.00009999999999999999  Rounded Inexact
821ddadd71118 add -1e-5 +1e-383   -> -0.000009999999999999999  Rounded Inexact
822ddadd71119 add -1e-6 +1e-383   -> -9.999999999999999E-7  Rounded Inexact
823
824-- tests based on Gunnar Degnbol's edge case
825rounding:     half_even
826
827ddadd71300 add 1E16  -0.5                 ->  1.000000000000000E+16 Inexact Rounded
828ddadd71310 add 1E16  -0.51                ->  9999999999999999      Inexact Rounded
829ddadd71311 add 1E16  -0.501               ->  9999999999999999      Inexact Rounded
830ddadd71312 add 1E16  -0.5001              ->  9999999999999999      Inexact Rounded
831ddadd71313 add 1E16  -0.50001             ->  9999999999999999      Inexact Rounded
832ddadd71314 add 1E16  -0.500001            ->  9999999999999999      Inexact Rounded
833ddadd71315 add 1E16  -0.5000001           ->  9999999999999999      Inexact Rounded
834ddadd71316 add 1E16  -0.50000001          ->  9999999999999999      Inexact Rounded
835ddadd71317 add 1E16  -0.500000001         ->  9999999999999999      Inexact Rounded
836ddadd71318 add 1E16  -0.5000000001        ->  9999999999999999      Inexact Rounded
837ddadd71319 add 1E16  -0.50000000001       ->  9999999999999999      Inexact Rounded
838ddadd71320 add 1E16  -0.500000000001      ->  9999999999999999      Inexact Rounded
839ddadd71321 add 1E16  -0.5000000000001     ->  9999999999999999      Inexact Rounded
840ddadd71322 add 1E16  -0.50000000000001    ->  9999999999999999      Inexact Rounded
841ddadd71323 add 1E16  -0.500000000000001   ->  9999999999999999      Inexact Rounded
842ddadd71324 add 1E16  -0.5000000000000001  ->  9999999999999999      Inexact Rounded
843ddadd71325 add 1E16  -0.5000000000000000  ->  1.000000000000000E+16 Inexact Rounded
844ddadd71326 add 1E16  -0.500000000000000   ->  1.000000000000000E+16 Inexact Rounded
845ddadd71327 add 1E16  -0.50000000000000    ->  1.000000000000000E+16 Inexact Rounded
846ddadd71328 add 1E16  -0.5000000000000     ->  1.000000000000000E+16 Inexact Rounded
847ddadd71329 add 1E16  -0.500000000000      ->  1.000000000000000E+16 Inexact Rounded
848ddadd71330 add 1E16  -0.50000000000       ->  1.000000000000000E+16 Inexact Rounded
849ddadd71331 add 1E16  -0.5000000000        ->  1.000000000000000E+16 Inexact Rounded
850ddadd71332 add 1E16  -0.500000000         ->  1.000000000000000E+16 Inexact Rounded
851ddadd71333 add 1E16  -0.50000000          ->  1.000000000000000E+16 Inexact Rounded
852ddadd71334 add 1E16  -0.5000000           ->  1.000000000000000E+16 Inexact Rounded
853ddadd71335 add 1E16  -0.500000            ->  1.000000000000000E+16 Inexact Rounded
854ddadd71336 add 1E16  -0.50000             ->  1.000000000000000E+16 Inexact Rounded
855ddadd71337 add 1E16  -0.5000              ->  1.000000000000000E+16 Inexact Rounded
856ddadd71338 add 1E16  -0.500               ->  1.000000000000000E+16 Inexact Rounded
857ddadd71339 add 1E16  -0.50                ->  1.000000000000000E+16 Inexact Rounded
858
859ddadd71340 add 1E16  -5000000.000010001   ->  9999999995000000      Inexact Rounded
860ddadd71341 add 1E16  -5000000.000000001   ->  9999999995000000      Inexact Rounded
861
862ddadd71349 add 9999999999999999 0.4                 ->  9999999999999999      Inexact Rounded
863ddadd71350 add 9999999999999999 0.49                ->  9999999999999999      Inexact Rounded
864ddadd71351 add 9999999999999999 0.499               ->  9999999999999999      Inexact Rounded
865ddadd71352 add 9999999999999999 0.4999              ->  9999999999999999      Inexact Rounded
866ddadd71353 add 9999999999999999 0.49999             ->  9999999999999999      Inexact Rounded
867ddadd71354 add 9999999999999999 0.499999            ->  9999999999999999      Inexact Rounded
868ddadd71355 add 9999999999999999 0.4999999           ->  9999999999999999      Inexact Rounded
869ddadd71356 add 9999999999999999 0.49999999          ->  9999999999999999      Inexact Rounded
870ddadd71357 add 9999999999999999 0.499999999         ->  9999999999999999      Inexact Rounded
871ddadd71358 add 9999999999999999 0.4999999999        ->  9999999999999999      Inexact Rounded
872ddadd71359 add 9999999999999999 0.49999999999       ->  9999999999999999      Inexact Rounded
873ddadd71360 add 9999999999999999 0.499999999999      ->  9999999999999999      Inexact Rounded
874ddadd71361 add 9999999999999999 0.4999999999999     ->  9999999999999999      Inexact Rounded
875ddadd71362 add 9999999999999999 0.49999999999999    ->  9999999999999999      Inexact Rounded
876ddadd71363 add 9999999999999999 0.499999999999999   ->  9999999999999999      Inexact Rounded
877ddadd71364 add 9999999999999999 0.4999999999999999  ->  9999999999999999      Inexact Rounded
878ddadd71365 add 9999999999999999 0.5000000000000000  ->  1.000000000000000E+16 Inexact Rounded
879ddadd71367 add 9999999999999999 0.500000000000000   ->  1.000000000000000E+16 Inexact Rounded
880ddadd71368 add 9999999999999999 0.50000000000000    ->  1.000000000000000E+16 Inexact Rounded
881ddadd71369 add 9999999999999999 0.5000000000000     ->  1.000000000000000E+16 Inexact Rounded
882ddadd71370 add 9999999999999999 0.500000000000      ->  1.000000000000000E+16 Inexact Rounded
883ddadd71371 add 9999999999999999 0.50000000000       ->  1.000000000000000E+16 Inexact Rounded
884ddadd71372 add 9999999999999999 0.5000000000        ->  1.000000000000000E+16 Inexact Rounded
885ddadd71373 add 9999999999999999 0.500000000         ->  1.000000000000000E+16 Inexact Rounded
886ddadd71374 add 9999999999999999 0.50000000          ->  1.000000000000000E+16 Inexact Rounded
887ddadd71375 add 9999999999999999 0.5000000           ->  1.000000000000000E+16 Inexact Rounded
888ddadd71376 add 9999999999999999 0.500000            ->  1.000000000000000E+16 Inexact Rounded
889ddadd71377 add 9999999999999999 0.50000             ->  1.000000000000000E+16 Inexact Rounded
890ddadd71378 add 9999999999999999 0.5000              ->  1.000000000000000E+16 Inexact Rounded
891ddadd71379 add 9999999999999999 0.500               ->  1.000000000000000E+16 Inexact Rounded
892ddadd71380 add 9999999999999999 0.50                ->  1.000000000000000E+16 Inexact Rounded
893ddadd71381 add 9999999999999999 0.5                 ->  1.000000000000000E+16 Inexact Rounded
894ddadd71382 add 9999999999999999 0.5000000000000001  ->  1.000000000000000E+16 Inexact Rounded
895ddadd71383 add 9999999999999999 0.500000000000001   ->  1.000000000000000E+16 Inexact Rounded
896ddadd71384 add 9999999999999999 0.50000000000001    ->  1.000000000000000E+16 Inexact Rounded
…

Large files files are truncated, but you can click here to view the full file