PageRenderTime 525ms CodeModel.GetById 142ms app.highlight 120ms RepoModel.GetById 141ms app.codeStats 1ms

/Lib/test/decimaltestdata/add.decTest

http://unladen-swallow.googlecode.com/
Unknown | 2716 lines | 2516 code | 200 blank | 0 comment | 0 complexity | 8c4c59002a02c5103a9f87e539068de6 MD5 | raw file

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

   1------/cancell----------------------------------------------------------
   2-- add.decTest -- decimal 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
  22precision:   9
  23rounding:    half_up
  24maxExponent: 384
  25minexponent: -383
  26extended:    1
  27
  28-- [first group are 'quick confidence check']
  29addx001 add 1       1       ->  2
  30addx002 add 2       3       ->  5
  31addx003 add '5.75'  '3.3'   ->  9.05
  32addx004 add '5'     '-3'    ->  2
  33addx005 add '-5'    '-3'    ->  -8
  34addx006 add '-7'    '2.5'   ->  -4.5
  35addx007 add '0.7'   '0.3'   ->  1.0
  36addx008 add '1.25'  '1.25'  ->  2.50
  37addx009 add '1.23456789'  '1.00000000' -> '2.23456789'
  38addx010 add '1.23456789'  '1.00000011' -> '2.23456800'
  39
  40addx011 add '0.4444444444'  '0.5555555555' -> '1.00000000' Inexact Rounded
  41addx012 add '0.4444444440'  '0.5555555555' -> '1.00000000' Inexact Rounded
  42addx013 add '0.4444444444'  '0.5555555550' -> '0.999999999' Inexact Rounded
  43addx014 add '0.44444444449'    '0' -> '0.444444444' Inexact Rounded
  44addx015 add '0.444444444499'   '0' -> '0.444444444' Inexact Rounded
  45addx016 add '0.4444444444999'  '0' -> '0.444444444' Inexact Rounded
  46addx017 add '0.4444444445000'  '0' -> '0.444444445' Inexact Rounded
  47addx018 add '0.4444444445001'  '0' -> '0.444444445' Inexact Rounded
  48addx019 add '0.444444444501'   '0' -> '0.444444445' Inexact Rounded
  49addx020 add '0.44444444451'    '0' -> '0.444444445' Inexact Rounded
  50
  51addx021 add 0 1 -> 1
  52addx022 add 1 1 -> 2
  53addx023 add 2 1 -> 3
  54addx024 add 3 1 -> 4
  55addx025 add 4 1 -> 5
  56addx026 add 5 1 -> 6
  57addx027 add 6 1 -> 7
  58addx028 add 7 1 -> 8
  59addx029 add 8 1 -> 9
  60addx030 add 9 1 -> 10
  61
  62-- some carrying effects
  63addx031 add '0.9998'  '0.0000' -> '0.9998'
  64addx032 add '0.9998'  '0.0001' -> '0.9999'
  65addx033 add '0.9998'  '0.0002' -> '1.0000'
  66addx034 add '0.9998'  '0.0003' -> '1.0001'
  67
  68addx035 add '70'  '10000e+9' -> '1.00000000E+13' Inexact Rounded
  69addx036 add '700'  '10000e+9' -> '1.00000000E+13' Inexact Rounded
  70addx037 add '7000'  '10000e+9' -> '1.00000000E+13' Inexact Rounded
  71addx038 add '70000'  '10000e+9' -> '1.00000001E+13' Inexact Rounded
  72addx039 add '700000'  '10000e+9' -> '1.00000007E+13' Rounded
  73
  74-- symmetry:
  75addx040 add '10000e+9'  '70' -> '1.00000000E+13' Inexact Rounded
  76addx041 add '10000e+9'  '700' -> '1.00000000E+13' Inexact Rounded
  77addx042 add '10000e+9'  '7000' -> '1.00000000E+13' Inexact Rounded
  78addx044 add '10000e+9'  '70000' -> '1.00000001E+13' Inexact Rounded
  79addx045 add '10000e+9'  '700000' -> '1.00000007E+13' Rounded
  80
  81-- same, higher precision
  82precision: 15
  83addx046 add '10000e+9'  '7' -> '10000000000007'
  84addx047 add '10000e+9'  '70' -> '10000000000070'
  85addx048 add '10000e+9'  '700' -> '10000000000700'
  86addx049 add '10000e+9'  '7000' -> '10000000007000'
  87addx050 add '10000e+9'  '70000' -> '10000000070000'
  88addx051 add '10000e+9'  '700000' -> '10000000700000'
  89addx052 add '10000e+9'  '7000000' -> '10000007000000'
  90
  91-- examples from decarith
  92addx053 add '12' '7.00' -> '19.00'
  93addx054 add '1.3' '-1.07' -> '0.23'
  94addx055 add '1.3' '-1.30' -> '0.00'
  95addx056 add '1.3' '-2.07' -> '-0.77'
  96addx057 add '1E+2' '1E+4' -> '1.01E+4'
  97
  98-- zero preservation
  99precision: 6
 100addx060 add '10000e+9'  '70000' -> '1.00000E+13' Inexact Rounded
 101addx061 add 1 '0.0001' -> '1.0001'
 102addx062 add 1 '0.00001' -> '1.00001'
 103addx063 add 1 '0.000001' -> '1.00000' Inexact Rounded
 104addx064 add 1 '0.0000001' -> '1.00000' Inexact Rounded
 105addx065 add 1 '0.00000001' -> '1.00000' Inexact Rounded
 106
 107-- some funny zeros [in case of bad signum]
 108addx070 add 1  0    -> 1
 109addx071 add 1 0.    -> 1
 110addx072 add 1  .0   -> 1.0
 111addx073 add 1 0.0   -> 1.0
 112addx074 add 1 0.00  -> 1.00
 113addx075 add  0  1   -> 1
 114addx076 add 0.  1   -> 1
 115addx077 add  .0 1   -> 1.0
 116addx078 add 0.0 1   -> 1.0
 117addx079 add 0.00 1  -> 1.00
 118
 119precision: 9
 120
 121-- some carries
 122addx080 add 999999998 1  -> 999999999
 123addx081 add 999999999 1  -> 1.00000000E+9 Rounded
 124addx082 add  99999999 1  -> 100000000
 125addx083 add   9999999 1  -> 10000000
 126addx084 add    999999 1  -> 1000000
 127addx085 add     99999 1  -> 100000
 128addx086 add      9999 1  -> 10000
 129addx087 add       999 1  -> 1000
 130addx088 add        99 1  -> 100
 131addx089 add         9 1  -> 10
 132
 133
 134-- more LHS swaps
 135addx090 add '-56267E-10'   0 ->  '-0.0000056267'
 136addx091 add '-56267E-6'    0 ->  '-0.056267'
 137addx092 add '-56267E-5'    0 ->  '-0.56267'
 138addx093 add '-56267E-4'    0 ->  '-5.6267'
 139addx094 add '-56267E-3'    0 ->  '-56.267'
 140addx095 add '-56267E-2'    0 ->  '-562.67'
 141addx096 add '-56267E-1'    0 ->  '-5626.7'
 142addx097 add '-56267E-0'    0 ->  '-56267'
 143addx098 add '-5E-10'       0 ->  '-5E-10'
 144addx099 add '-5E-7'        0 ->  '-5E-7'
 145addx100 add '-5E-6'        0 ->  '-0.000005'
 146addx101 add '-5E-5'        0 ->  '-0.00005'
 147addx102 add '-5E-4'        0 ->  '-0.0005'
 148addx103 add '-5E-1'        0 ->  '-0.5'
 149addx104 add '-5E0'         0 ->  '-5'
 150addx105 add '-5E1'         0 ->  '-50'
 151addx106 add '-5E5'         0 ->  '-500000'
 152addx107 add '-5E8'         0 ->  '-500000000'
 153addx108 add '-5E9'         0 ->  '-5.00000000E+9'   Rounded
 154addx109 add '-5E10'        0 ->  '-5.00000000E+10'  Rounded
 155addx110 add '-5E11'        0 ->  '-5.00000000E+11'  Rounded
 156addx111 add '-5E100'       0 ->  '-5.00000000E+100' Rounded
 157
 158-- more RHS swaps
 159addx113 add 0  '-56267E-10' ->  '-0.0000056267'
 160addx114 add 0  '-56267E-6'  ->  '-0.056267'
 161addx116 add 0  '-56267E-5'  ->  '-0.56267'
 162addx117 add 0  '-56267E-4'  ->  '-5.6267'
 163addx119 add 0  '-56267E-3'  ->  '-56.267'
 164addx120 add 0  '-56267E-2'  ->  '-562.67'
 165addx121 add 0  '-56267E-1'  ->  '-5626.7'
 166addx122 add 0  '-56267E-0'  ->  '-56267'
 167addx123 add 0  '-5E-10'     ->  '-5E-10'
 168addx124 add 0  '-5E-7'      ->  '-5E-7'
 169addx125 add 0  '-5E-6'      ->  '-0.000005'
 170addx126 add 0  '-5E-5'      ->  '-0.00005'
 171addx127 add 0  '-5E-4'      ->  '-0.0005'
 172addx128 add 0  '-5E-1'      ->  '-0.5'
 173addx129 add 0  '-5E0'       ->  '-5'
 174addx130 add 0  '-5E1'       ->  '-50'
 175addx131 add 0  '-5E5'       ->  '-500000'
 176addx132 add 0  '-5E8'       ->  '-500000000'
 177addx133 add 0  '-5E9'       ->  '-5.00000000E+9'    Rounded
 178addx134 add 0  '-5E10'      ->  '-5.00000000E+10'   Rounded
 179addx135 add 0  '-5E11'      ->  '-5.00000000E+11'   Rounded
 180addx136 add 0  '-5E100'     ->  '-5.00000000E+100'  Rounded
 181
 182-- related
 183addx137 add  1  '0E-12'      ->  '1.00000000'  Rounded
 184addx138 add -1  '0E-12'      ->  '-1.00000000' Rounded
 185addx139 add '0E-12' 1        ->  '1.00000000'  Rounded
 186addx140 add '0E-12' -1       ->  '-1.00000000' Rounded
 187addx141 add 1E+4    0.0000   ->  '10000.0000'
 188addx142 add 1E+4    0.00000  ->  '10000.0000'  Rounded
 189addx143 add 0.000   1E+5     ->  '100000.000'
 190addx144 add 0.0000  1E+5     ->  '100000.000'  Rounded
 191
 192-- [some of the next group are really constructor tests]
 193addx146 add '00.0'  0       ->  '0.0'
 194addx147 add '0.00'  0       ->  '0.00'
 195addx148 add  0      '0.00'  ->  '0.00'
 196addx149 add  0      '00.0'  ->  '0.0'
 197addx150 add '00.0'  '0.00'  ->  '0.00'
 198addx151 add '0.00'  '00.0'  ->  '0.00'
 199addx152 add '3'     '.3'    ->  '3.3'
 200addx153 add '3.'    '.3'    ->  '3.3'
 201addx154 add '3.0'   '.3'    ->  '3.3'
 202addx155 add '3.00'  '.3'    ->  '3.30'
 203addx156 add '3'     '3'     ->  '6'
 204addx157 add '3'     '+3'    ->  '6'
 205addx158 add '3'     '-3'    ->  '0'
 206addx159 add '0.3'   '-0.3'  ->  '0.0'
 207addx160 add '0.03'  '-0.03' ->  '0.00'
 208
 209-- try borderline precision, with carries, etc.
 210precision: 15
 211addx161 add '1E+12' '-1'    -> '999999999999'
 212addx162 add '1E+12'  '1.11' -> '1000000000001.11'
 213addx163 add '1.11'  '1E+12' -> '1000000000001.11'
 214addx164 add '-1'    '1E+12' -> '999999999999'
 215addx165 add '7E+12' '-1'    -> '6999999999999'
 216addx166 add '7E+12'  '1.11' -> '7000000000001.11'
 217addx167 add '1.11'  '7E+12' -> '7000000000001.11'
 218addx168 add '-1'    '7E+12' -> '6999999999999'
 219
 220--             123456789012345      123456789012345      1 23456789012345
 221addx170 add '0.444444444444444'  '0.555555555555563' -> '1.00000000000001' Inexact Rounded
 222addx171 add '0.444444444444444'  '0.555555555555562' -> '1.00000000000001' Inexact Rounded
 223addx172 add '0.444444444444444'  '0.555555555555561' -> '1.00000000000001' Inexact Rounded
 224addx173 add '0.444444444444444'  '0.555555555555560' -> '1.00000000000000' Inexact Rounded
 225addx174 add '0.444444444444444'  '0.555555555555559' -> '1.00000000000000' Inexact Rounded
 226addx175 add '0.444444444444444'  '0.555555555555558' -> '1.00000000000000' Inexact Rounded
 227addx176 add '0.444444444444444'  '0.555555555555557' -> '1.00000000000000' Inexact Rounded
 228addx177 add '0.444444444444444'  '0.555555555555556' -> '1.00000000000000' Rounded
 229addx178 add '0.444444444444444'  '0.555555555555555' -> '0.999999999999999'
 230addx179 add '0.444444444444444'  '0.555555555555554' -> '0.999999999999998'
 231addx180 add '0.444444444444444'  '0.555555555555553' -> '0.999999999999997'
 232addx181 add '0.444444444444444'  '0.555555555555552' -> '0.999999999999996'
 233addx182 add '0.444444444444444'  '0.555555555555551' -> '0.999999999999995'
 234addx183 add '0.444444444444444'  '0.555555555555550' -> '0.999999999999994'
 235
 236-- and some more, including residue effects and different roundings
 237precision: 9
 238rounding: half_up
 239addx200 add '123456789' 0             -> '123456789'
 240addx201 add '123456789' 0.000000001   -> '123456789' Inexact Rounded
 241addx202 add '123456789' 0.000001      -> '123456789' Inexact Rounded
 242addx203 add '123456789' 0.1           -> '123456789' Inexact Rounded
 243addx204 add '123456789' 0.4           -> '123456789' Inexact Rounded
 244addx205 add '123456789' 0.49          -> '123456789' Inexact Rounded
 245addx206 add '123456789' 0.499999      -> '123456789' Inexact Rounded
 246addx207 add '123456789' 0.499999999   -> '123456789' Inexact Rounded
 247addx208 add '123456789' 0.5           -> '123456790' Inexact Rounded
 248addx209 add '123456789' 0.500000001   -> '123456790' Inexact Rounded
 249addx210 add '123456789' 0.500001      -> '123456790' Inexact Rounded
 250addx211 add '123456789' 0.51          -> '123456790' Inexact Rounded
 251addx212 add '123456789' 0.6           -> '123456790' Inexact Rounded
 252addx213 add '123456789' 0.9           -> '123456790' Inexact Rounded
 253addx214 add '123456789' 0.99999       -> '123456790' Inexact Rounded
 254addx215 add '123456789' 0.999999999   -> '123456790' Inexact Rounded
 255addx216 add '123456789' 1             -> '123456790'
 256addx217 add '123456789' 1.000000001   -> '123456790' Inexact Rounded
 257addx218 add '123456789' 1.00001       -> '123456790' Inexact Rounded
 258addx219 add '123456789' 1.1           -> '123456790' Inexact Rounded
 259
 260rounding: half_even
 261addx220 add '123456789' 0             -> '123456789'
 262addx221 add '123456789' 0.000000001   -> '123456789' Inexact Rounded
 263addx222 add '123456789' 0.000001      -> '123456789' Inexact Rounded
 264addx223 add '123456789' 0.1           -> '123456789' Inexact Rounded
 265addx224 add '123456789' 0.4           -> '123456789' Inexact Rounded
 266addx225 add '123456789' 0.49          -> '123456789' Inexact Rounded
 267addx226 add '123456789' 0.499999      -> '123456789' Inexact Rounded
 268addx227 add '123456789' 0.499999999   -> '123456789' Inexact Rounded
 269addx228 add '123456789' 0.5           -> '123456790' Inexact Rounded
 270addx229 add '123456789' 0.500000001   -> '123456790' Inexact Rounded
 271addx230 add '123456789' 0.500001      -> '123456790' Inexact Rounded
 272addx231 add '123456789' 0.51          -> '123456790' Inexact Rounded
 273addx232 add '123456789' 0.6           -> '123456790' Inexact Rounded
 274addx233 add '123456789' 0.9           -> '123456790' Inexact Rounded
 275addx234 add '123456789' 0.99999       -> '123456790' Inexact Rounded
 276addx235 add '123456789' 0.999999999   -> '123456790' Inexact Rounded
 277addx236 add '123456789' 1             -> '123456790'
 278addx237 add '123456789' 1.00000001    -> '123456790' Inexact Rounded
 279addx238 add '123456789' 1.00001       -> '123456790' Inexact Rounded
 280addx239 add '123456789' 1.1           -> '123456790' Inexact Rounded
 281-- critical few with even bottom digit...
 282addx240 add '123456788' 0.499999999   -> '123456788' Inexact Rounded
 283addx241 add '123456788' 0.5           -> '123456788' Inexact Rounded
 284addx242 add '123456788' 0.500000001   -> '123456789' Inexact Rounded
 285
 286rounding: down
 287addx250 add '123456789' 0             -> '123456789'
 288addx251 add '123456789' 0.000000001   -> '123456789' Inexact Rounded
 289addx252 add '123456789' 0.000001      -> '123456789' Inexact Rounded
 290addx253 add '123456789' 0.1           -> '123456789' Inexact Rounded
 291addx254 add '123456789' 0.4           -> '123456789' Inexact Rounded
 292addx255 add '123456789' 0.49          -> '123456789' Inexact Rounded
 293addx256 add '123456789' 0.499999      -> '123456789' Inexact Rounded
 294addx257 add '123456789' 0.499999999   -> '123456789' Inexact Rounded
 295addx258 add '123456789' 0.5           -> '123456789' Inexact Rounded
 296addx259 add '123456789' 0.500000001   -> '123456789' Inexact Rounded
 297addx260 add '123456789' 0.500001      -> '123456789' Inexact Rounded
 298addx261 add '123456789' 0.51          -> '123456789' Inexact Rounded
 299addx262 add '123456789' 0.6           -> '123456789' Inexact Rounded
 300addx263 add '123456789' 0.9           -> '123456789' Inexact Rounded
 301addx264 add '123456789' 0.99999       -> '123456789' Inexact Rounded
 302addx265 add '123456789' 0.999999999   -> '123456789' Inexact Rounded
 303addx266 add '123456789' 1             -> '123456790'
 304addx267 add '123456789' 1.00000001    -> '123456790' Inexact Rounded
 305addx268 add '123456789' 1.00001       -> '123456790' Inexact Rounded
 306addx269 add '123456789' 1.1           -> '123456790' Inexact Rounded
 307
 308-- input preparation tests (operands should not be rounded)
 309precision: 3
 310rounding: half_up
 311
 312addx270 add '12345678900000'  9999999999999 ->  '2.23E+13' Inexact Rounded
 313addx271 add  '9999999999999' 12345678900000 ->  '2.23E+13' Inexact Rounded
 314
 315addx272 add '12E+3'  '3444'   ->  '1.54E+4' Inexact Rounded
 316addx273 add '12E+3'  '3446'   ->  '1.54E+4' Inexact Rounded
 317addx274 add '12E+3'  '3449.9' ->  '1.54E+4' Inexact Rounded
 318addx275 add '12E+3'  '3450.0' ->  '1.55E+4' Inexact Rounded
 319addx276 add '12E+3'  '3450.1' ->  '1.55E+4' Inexact Rounded
 320addx277 add '12E+3'  '3454'   ->  '1.55E+4' Inexact Rounded
 321addx278 add '12E+3'  '3456'   ->  '1.55E+4' Inexact Rounded
 322
 323addx281 add '3444'   '12E+3'  ->  '1.54E+4' Inexact Rounded
 324addx282 add '3446'   '12E+3'  ->  '1.54E+4' Inexact Rounded
 325addx283 add '3449.9' '12E+3'  ->  '1.54E+4' Inexact Rounded
 326addx284 add '3450.0' '12E+3'  ->  '1.55E+4' Inexact Rounded
 327addx285 add '3450.1' '12E+3'  ->  '1.55E+4' Inexact Rounded
 328addx286 add '3454'   '12E+3'  ->  '1.55E+4' Inexact Rounded
 329addx287 add '3456'   '12E+3'  ->  '1.55E+4' Inexact Rounded
 330
 331rounding: half_down
 332addx291 add '3444'   '12E+3'  ->  '1.54E+4' Inexact Rounded
 333addx292 add '3446'   '12E+3'  ->  '1.54E+4' Inexact Rounded
 334addx293 add '3449.9' '12E+3'  ->  '1.54E+4' Inexact Rounded
 335addx294 add '3450.0' '12E+3'  ->  '1.54E+4' Inexact Rounded
 336addx295 add '3450.1' '12E+3'  ->  '1.55E+4' Inexact Rounded
 337addx296 add '3454'   '12E+3'  ->  '1.55E+4' Inexact Rounded
 338addx297 add '3456'   '12E+3'  ->  '1.55E+4' Inexact Rounded
 339
 340-- 1 in last place tests
 341rounding: half_up
 342addx301 add  -1   1      ->   0
 343addx302 add   0   1      ->   1
 344addx303 add   1   1      ->   2
 345addx304 add  12   1      ->  13
 346addx305 add  98   1      ->  99
 347addx306 add  99   1      -> 100
 348addx307 add 100   1      -> 101
 349addx308 add 101   1      -> 102
 350addx309 add  -1  -1      ->  -2
 351addx310 add   0  -1      ->  -1
 352addx311 add   1  -1      ->   0
 353addx312 add  12  -1      ->  11
 354addx313 add  98  -1      ->  97
 355addx314 add  99  -1      ->  98
 356addx315 add 100  -1      ->  99
 357addx316 add 101  -1      -> 100
 358
 359addx321 add -0.01  0.01    ->  0.00
 360addx322 add  0.00  0.01    ->  0.01
 361addx323 add  0.01  0.01    ->  0.02
 362addx324 add  0.12  0.01    ->  0.13
 363addx325 add  0.98  0.01    ->  0.99
 364addx326 add  0.99  0.01    ->  1.00
 365addx327 add  1.00  0.01    ->  1.01
 366addx328 add  1.01  0.01    ->  1.02
 367addx329 add -0.01 -0.01    -> -0.02
 368addx330 add  0.00 -0.01    -> -0.01
 369addx331 add  0.01 -0.01    ->  0.00
 370addx332 add  0.12 -0.01    ->  0.11
 371addx333 add  0.98 -0.01    ->  0.97
 372addx334 add  0.99 -0.01    ->  0.98
 373addx335 add  1.00 -0.01    ->  0.99
 374addx336 add  1.01 -0.01    ->  1.00
 375
 376-- some more cases where adding 0 affects the coefficient
 377precision: 9
 378addx340 add 1E+3    0    ->         1000
 379addx341 add 1E+8    0    ->    100000000
 380addx342 add 1E+9    0    ->   1.00000000E+9   Rounded
 381addx343 add 1E+10   0    ->   1.00000000E+10  Rounded
 382-- which simply follow from these cases ...
 383addx344 add 1E+3    1    ->         1001
 384addx345 add 1E+8    1    ->    100000001
 385addx346 add 1E+9    1    ->   1.00000000E+9   Inexact Rounded
 386addx347 add 1E+10   1    ->   1.00000000E+10  Inexact Rounded
 387addx348 add 1E+3    7    ->         1007
 388addx349 add 1E+8    7    ->    100000007
 389addx350 add 1E+9    7    ->   1.00000001E+9   Inexact Rounded
 390addx351 add 1E+10   7    ->   1.00000000E+10  Inexact Rounded
 391
 392-- tryzeros cases
 393precision:   7
 394rounding:    half_up
 395maxExponent: 92
 396minexponent: -92
 397addx361  add 0E+50 10000E+1  -> 1.0000E+5
 398addx362  add 10000E+1 0E-50  -> 100000.0  Rounded
 399addx363  add 10000E+1 10000E-50  -> 100000.0  Rounded Inexact
 400addx364  add 9.999999E+92 -9.999999E+92 -> 0E+86
 401
 402-- a curiosity from JSR 13 testing
 403rounding:    half_down
 404precision:   10
 405addx370 add 99999999 81512 -> 100081511
 406precision:      6
 407addx371 add 99999999 81512 -> 1.00082E+8 Rounded Inexact
 408rounding:    half_up
 409precision:   10
 410addx372 add 99999999 81512 -> 100081511
 411precision:      6
 412addx373 add 99999999 81512 -> 1.00082E+8 Rounded Inexact
 413rounding:    half_even
 414precision:   10
 415addx374 add 99999999 81512 -> 100081511
 416precision:      6
 417addx375 add 99999999 81512 -> 1.00082E+8 Rounded Inexact
 418
 419-- ulp replacement tests
 420precision: 9
 421maxexponent: 999999999
 422minexponent: -999999999
 423addx400 add   1   77e-7       ->  1.0000077
 424addx401 add   1   77e-8       ->  1.00000077
 425addx402 add   1   77e-9       ->  1.00000008 Inexact Rounded
 426addx403 add   1   77e-10      ->  1.00000001 Inexact Rounded
 427addx404 add   1   77e-11      ->  1.00000000 Inexact Rounded
 428addx405 add   1   77e-12      ->  1.00000000 Inexact Rounded
 429addx406 add   1   77e-999     ->  1.00000000 Inexact Rounded
 430addx407 add   1   77e-9999999 ->  1.00000000 Inexact Rounded
 431
 432addx410 add  10   77e-7       ->  10.0000077
 433addx411 add  10   77e-8       ->  10.0000008 Inexact Rounded
 434addx412 add  10   77e-9       ->  10.0000001 Inexact Rounded
 435addx413 add  10   77e-10      ->  10.0000000 Inexact Rounded
 436addx414 add  10   77e-11      ->  10.0000000 Inexact Rounded
 437addx415 add  10   77e-12      ->  10.0000000 Inexact Rounded
 438addx416 add  10   77e-999     ->  10.0000000 Inexact Rounded
 439addx417 add  10   77e-9999999 ->  10.0000000 Inexact Rounded
 440
 441addx420 add  77e-7        1   ->  1.0000077
 442addx421 add  77e-8        1   ->  1.00000077
 443addx422 add  77e-9        1   ->  1.00000008 Inexact Rounded
 444addx423 add  77e-10       1   ->  1.00000001 Inexact Rounded
 445addx424 add  77e-11       1   ->  1.00000000 Inexact Rounded
 446addx425 add  77e-12       1   ->  1.00000000 Inexact Rounded
 447addx426 add  77e-999      1   ->  1.00000000 Inexact Rounded
 448addx427 add  77e-9999999  1   ->  1.00000000 Inexact Rounded
 449
 450addx430 add  77e-7       10   ->  10.0000077
 451addx431 add  77e-8       10   ->  10.0000008 Inexact Rounded
 452addx432 add  77e-9       10   ->  10.0000001 Inexact Rounded
 453addx433 add  77e-10      10   ->  10.0000000 Inexact Rounded
 454addx434 add  77e-11      10   ->  10.0000000 Inexact Rounded
 455addx435 add  77e-12      10   ->  10.0000000 Inexact Rounded
 456addx436 add  77e-999     10   ->  10.0000000 Inexact Rounded
 457addx437 add  77e-9999999 10   ->  10.0000000 Inexact Rounded
 458
 459-- negative ulps
 460addx440 add   1   -77e-7       ->  0.9999923
 461addx441 add   1   -77e-8       ->  0.99999923
 462addx442 add   1   -77e-9       ->  0.999999923
 463addx443 add   1   -77e-10      ->  0.999999992 Inexact Rounded
 464addx444 add   1   -77e-11      ->  0.999999999 Inexact Rounded
 465addx445 add   1   -77e-12      ->  1.00000000 Inexact Rounded
 466addx446 add   1   -77e-999     ->  1.00000000 Inexact Rounded
 467addx447 add   1   -77e-9999999 ->  1.00000000 Inexact Rounded
 468
 469addx450 add  10   -77e-7       ->   9.9999923
 470addx451 add  10   -77e-8       ->   9.99999923
 471addx452 add  10   -77e-9       ->   9.99999992 Inexact Rounded
 472addx453 add  10   -77e-10      ->   9.99999999 Inexact Rounded
 473addx454 add  10   -77e-11      ->  10.0000000 Inexact Rounded
 474addx455 add  10   -77e-12      ->  10.0000000 Inexact Rounded
 475addx456 add  10   -77e-999     ->  10.0000000 Inexact Rounded
 476addx457 add  10   -77e-9999999 ->  10.0000000 Inexact Rounded
 477
 478addx460 add  -77e-7        1   ->  0.9999923
 479addx461 add  -77e-8        1   ->  0.99999923
 480addx462 add  -77e-9        1   ->  0.999999923
 481addx463 add  -77e-10       1   ->  0.999999992 Inexact Rounded
 482addx464 add  -77e-11       1   ->  0.999999999 Inexact Rounded
 483addx465 add  -77e-12       1   ->  1.00000000 Inexact Rounded
 484addx466 add  -77e-999      1   ->  1.00000000 Inexact Rounded
 485addx467 add  -77e-9999999  1   ->  1.00000000 Inexact Rounded
 486
 487addx470 add  -77e-7       10   ->   9.9999923
 488addx471 add  -77e-8       10   ->   9.99999923
 489addx472 add  -77e-9       10   ->   9.99999992 Inexact Rounded
 490addx473 add  -77e-10      10   ->   9.99999999 Inexact Rounded
 491addx474 add  -77e-11      10   ->  10.0000000 Inexact Rounded
 492addx475 add  -77e-12      10   ->  10.0000000 Inexact Rounded
 493addx476 add  -77e-999     10   ->  10.0000000 Inexact Rounded
 494addx477 add  -77e-9999999 10   ->  10.0000000 Inexact Rounded
 495
 496-- negative ulps
 497addx480 add  -1    77e-7       ->  -0.9999923
 498addx481 add  -1    77e-8       ->  -0.99999923
 499addx482 add  -1    77e-9       ->  -0.999999923
 500addx483 add  -1    77e-10      ->  -0.999999992 Inexact Rounded
 501addx484 add  -1    77e-11      ->  -0.999999999 Inexact Rounded
 502addx485 add  -1    77e-12      ->  -1.00000000 Inexact Rounded
 503addx486 add  -1    77e-999     ->  -1.00000000 Inexact Rounded
 504addx487 add  -1    77e-9999999 ->  -1.00000000 Inexact Rounded
 505
 506addx490 add -10    77e-7       ->   -9.9999923
 507addx491 add -10    77e-8       ->   -9.99999923
 508addx492 add -10    77e-9       ->   -9.99999992 Inexact Rounded
 509addx493 add -10    77e-10      ->   -9.99999999 Inexact Rounded
 510addx494 add -10    77e-11      ->  -10.0000000 Inexact Rounded
 511addx495 add -10    77e-12      ->  -10.0000000 Inexact Rounded
 512addx496 add -10    77e-999     ->  -10.0000000 Inexact Rounded
 513addx497 add -10    77e-9999999 ->  -10.0000000 Inexact Rounded
 514
 515addx500 add   77e-7       -1   ->  -0.9999923
 516addx501 add   77e-8       -1   ->  -0.99999923
 517addx502 add   77e-9       -1   ->  -0.999999923
 518addx503 add   77e-10      -1   ->  -0.999999992 Inexact Rounded
 519addx504 add   77e-11      -1   ->  -0.999999999 Inexact Rounded
 520addx505 add   77e-12      -1   ->  -1.00000000 Inexact Rounded
 521addx506 add   77e-999     -1   ->  -1.00000000 Inexact Rounded
 522addx507 add   77e-9999999 -1   ->  -1.00000000 Inexact Rounded
 523
 524addx510 add   77e-7       -10  ->   -9.9999923
 525addx511 add   77e-8       -10  ->   -9.99999923
 526addx512 add   77e-9       -10  ->   -9.99999992 Inexact Rounded
 527addx513 add   77e-10      -10  ->   -9.99999999 Inexact Rounded
 528addx514 add   77e-11      -10  ->  -10.0000000 Inexact Rounded
 529addx515 add   77e-12      -10  ->  -10.0000000 Inexact Rounded
 530addx516 add   77e-999     -10  ->  -10.0000000 Inexact Rounded
 531addx517 add   77e-9999999 -10  ->  -10.0000000 Inexact Rounded
 532
 533
 534-- long operands
 535maxexponent: 999
 536minexponent: -999
 537precision: 9
 538addx521 add 12345678000 0 -> 1.23456780E+10 Rounded
 539addx522 add 0 12345678000 -> 1.23456780E+10 Rounded
 540addx523 add 1234567800  0 -> 1.23456780E+9 Rounded
 541addx524 add 0 1234567800  -> 1.23456780E+9 Rounded
 542addx525 add 1234567890  0 -> 1.23456789E+9 Rounded
 543addx526 add 0 1234567890  -> 1.23456789E+9 Rounded
 544addx527 add 1234567891  0 -> 1.23456789E+9 Inexact Rounded
 545addx528 add 0 1234567891  -> 1.23456789E+9 Inexact Rounded
 546addx529 add 12345678901 0 -> 1.23456789E+10 Inexact Rounded
 547addx530 add 0 12345678901 -> 1.23456789E+10 Inexact Rounded
 548addx531 add 1234567896  0 -> 1.23456790E+9 Inexact Rounded
 549addx532 add 0 1234567896  -> 1.23456790E+9 Inexact Rounded
 550
 551precision: 15
 552-- still checking
 553addx541 add 12345678000 0 -> 12345678000
 554addx542 add 0 12345678000 -> 12345678000
 555addx543 add 1234567800  0 -> 1234567800
 556addx544 add 0 1234567800  -> 1234567800
 557addx545 add 1234567890  0 -> 1234567890
 558addx546 add 0 1234567890  -> 1234567890
 559addx547 add 1234567891  0 -> 1234567891
 560addx548 add 0 1234567891  -> 1234567891
 561addx549 add 12345678901 0 -> 12345678901
 562addx550 add 0 12345678901 -> 12345678901
 563addx551 add 1234567896  0 -> 1234567896
 564addx552 add 0 1234567896  -> 1234567896
 565
 566-- verify a query
 567precision:    16
 568maxExponent: +394
 569minExponent: -393
 570rounding:     down
 571addx561 add 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
 572addx562 add      0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
 573-- and using decimal64 bounds (see also ddadd.decTest)
 574precision:    16
 575maxExponent: +384
 576minExponent: -383
 577rounding:     down
 578addx563 add 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
 579addx564 add      0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
 580
 581
 582-- some more residue effects with extreme rounding
 583precision:   9
 584rounding: half_up
 585addx601 add 123456789  0.000001 -> 123456789 Inexact Rounded
 586rounding: half_even
 587addx602 add 123456789  0.000001 -> 123456789 Inexact Rounded
 588rounding: half_down
 589addx603 add 123456789  0.000001 -> 123456789 Inexact Rounded
 590rounding: floor
 591addx604 add 123456789  0.000001 -> 123456789 Inexact Rounded
 592rounding: ceiling
 593addx605 add 123456789  0.000001 -> 123456790 Inexact Rounded
 594rounding: up
 595addx606 add 123456789  0.000001 -> 123456790 Inexact Rounded
 596rounding: down
 597addx607 add 123456789  0.000001 -> 123456789 Inexact Rounded
 598
 599rounding: half_up
 600addx611 add 123456789 -0.000001 -> 123456789 Inexact Rounded
 601rounding: half_even
 602addx612 add 123456789 -0.000001 -> 123456789 Inexact Rounded
 603rounding: half_down
 604addx613 add 123456789 -0.000001 -> 123456789 Inexact Rounded
 605rounding: floor
 606addx614 add 123456789 -0.000001 -> 123456788 Inexact Rounded
 607rounding: ceiling
 608addx615 add 123456789 -0.000001 -> 123456789 Inexact Rounded
 609rounding: up
 610addx616 add 123456789 -0.000001 -> 123456789 Inexact Rounded
 611rounding: down
 612addx617 add 123456789 -0.000001 -> 123456788 Inexact Rounded
 613
 614rounding: half_up
 615addx621 add 123456789  0.499999 -> 123456789 Inexact Rounded
 616rounding: half_even
 617addx622 add 123456789  0.499999 -> 123456789 Inexact Rounded
 618rounding: half_down
 619addx623 add 123456789  0.499999 -> 123456789 Inexact Rounded
 620rounding: floor
 621addx624 add 123456789  0.499999 -> 123456789 Inexact Rounded
 622rounding: ceiling
 623addx625 add 123456789  0.499999 -> 123456790 Inexact Rounded
 624rounding: up
 625addx626 add 123456789  0.499999 -> 123456790 Inexact Rounded
 626rounding: down
 627addx627 add 123456789  0.499999 -> 123456789 Inexact Rounded
 628
 629rounding: half_up
 630addx631 add 123456789 -0.499999 -> 123456789 Inexact Rounded
 631rounding: half_even
 632addx632 add 123456789 -0.499999 -> 123456789 Inexact Rounded
 633rounding: half_down
 634addx633 add 123456789 -0.499999 -> 123456789 Inexact Rounded
 635rounding: floor
 636addx634 add 123456789 -0.499999 -> 123456788 Inexact Rounded
 637rounding: ceiling
 638addx635 add 123456789 -0.499999 -> 123456789 Inexact Rounded
 639rounding: up
 640addx636 add 123456789 -0.499999 -> 123456789 Inexact Rounded
 641rounding: down
 642addx637 add 123456789 -0.499999 -> 123456788 Inexact Rounded
 643
 644rounding: half_up
 645addx641 add 123456789  0.500001 -> 123456790 Inexact Rounded
 646rounding: half_even
 647addx642 add 123456789  0.500001 -> 123456790 Inexact Rounded
 648rounding: half_down
 649addx643 add 123456789  0.500001 -> 123456790 Inexact Rounded
 650rounding: floor
 651addx644 add 123456789  0.500001 -> 123456789 Inexact Rounded
 652rounding: ceiling
 653addx645 add 123456789  0.500001 -> 123456790 Inexact Rounded
 654rounding: up
 655addx646 add 123456789  0.500001 -> 123456790 Inexact Rounded
 656rounding: down
 657addx647 add 123456789  0.500001 -> 123456789 Inexact Rounded
 658
 659rounding: half_up
 660addx651 add 123456789 -0.500001 -> 123456788 Inexact Rounded
 661rounding: half_even
 662addx652 add 123456789 -0.500001 -> 123456788 Inexact Rounded
 663rounding: half_down
 664addx653 add 123456789 -0.500001 -> 123456788 Inexact Rounded
 665rounding: floor
 666addx654 add 123456789 -0.500001 -> 123456788 Inexact Rounded
 667rounding: ceiling
 668addx655 add 123456789 -0.500001 -> 123456789 Inexact Rounded
 669rounding: up
 670addx656 add 123456789 -0.500001 -> 123456789 Inexact Rounded
 671rounding: down
 672addx657 add 123456789 -0.500001 -> 123456788 Inexact Rounded
 673
 674-- long operand triangle
 675rounding: half_up
 676precision:  37
 677addx660 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337114834538
 678precision:  36
 679addx661 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711483454  Inexact Rounded
 680precision:  35
 681addx662 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371148345   Inexact Rounded
 682precision:  34
 683addx663 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337114835    Inexact Rounded
 684precision:  33
 685addx664 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711483     Inexact Rounded
 686precision:  32
 687addx665 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371148      Inexact Rounded
 688precision:  31
 689addx666 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337115       Inexact Rounded
 690precision:  30
 691addx667 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711        Inexact Rounded
 692precision:  29
 693addx668 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371         Inexact Rounded
 694precision:  28
 695addx669 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337          Inexact Rounded
 696precision:  27
 697addx670 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892234           Inexact Rounded
 698precision:  26
 699addx671 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223            Inexact Rounded
 700precision:  25
 701addx672 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922             Inexact Rounded
 702precision:  24
 703addx673 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892              Inexact Rounded
 704precision:  23
 705addx674 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389               Inexact Rounded
 706precision:  22
 707addx675 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023639                Inexact Rounded
 708precision:  21
 709addx676 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102364                 Inexact Rounded
 710precision:  20
 711addx677 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236                  Inexact Rounded
 712precision:  19
 713addx678 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211024                   Inexact Rounded
 714precision:  18
 715addx679 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102                    Inexact Rounded
 716precision:  17
 717addx680 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110                     Inexact Rounded
 718precision:  16
 719addx681 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211                      Inexact Rounded
 720precision:  15
 721addx682 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221                       Inexact Rounded
 722precision:  14
 723addx683 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422                        Inexact Rounded
 724precision:  13
 725addx684 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42                         Inexact Rounded
 726precision:  12
 727addx685 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4                          Inexact Rounded
 728precision:  11
 729addx686 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166                            Inexact Rounded
 730precision:  10
 731addx687 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847117417E+10                        Inexact Rounded
 732precision:   9
 733addx688 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.84711742E+10                         Inexact Rounded
 734precision:   8
 735addx689 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8471174E+10                          Inexact Rounded
 736precision:   7
 737addx690 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847117E+10                          Inexact Rounded
 738precision:   6
 739addx691 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.84712E+10                          Inexact Rounded
 740precision:   5
 741addx692 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8471E+10                          Inexact Rounded
 742precision:   4
 743addx693 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847E+10                          Inexact Rounded
 744precision:   3
 745addx694 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.85E+10                          Inexact Rounded
 746precision:   2
 747addx695 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8E+10                          Inexact Rounded
 748precision:   1
 749addx696 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 1E+11                          Inexact Rounded
 750
 751-- more zeros, etc.
 752rounding: half_up
 753precision:   9
 754
 755addx701 add 5.00 1.00E-3 -> 5.00100
 756addx702 add 00.00 0.000  -> 0.000
 757addx703 add 00.00 0E-3   -> 0.000
 758addx704 add 0E-3  00.00  -> 0.000
 759
 760addx710 add 0E+3  00.00  -> 0.00
 761addx711 add 0E+3  00.0   -> 0.0
 762addx712 add 0E+3  00.    -> 0
 763addx713 add 0E+3  00.E+1 -> 0E+1
 764addx714 add 0E+3  00.E+2 -> 0E+2
 765addx715 add 0E+3  00.E+3 -> 0E+3
 766addx716 add 0E+3  00.E+4 -> 0E+3
 767addx717 add 0E+3  00.E+5 -> 0E+3
 768addx718 add 0E+3  -00.0   -> 0.0
 769addx719 add 0E+3  -00.    -> 0
 770addx731 add 0E+3  -00.E+1 -> 0E+1
 771
 772addx720 add 00.00  0E+3  -> 0.00
 773addx721 add 00.0   0E+3  -> 0.0
 774addx722 add 00.    0E+3  -> 0
 775addx723 add 00.E+1 0E+3  -> 0E+1
 776addx724 add 00.E+2 0E+3  -> 0E+2
 777addx725 add 00.E+3 0E+3  -> 0E+3
 778addx726 add 00.E+4 0E+3  -> 0E+3
 779addx727 add 00.E+5 0E+3  -> 0E+3
 780addx728 add -00.00 0E+3  -> 0.00
 781addx729 add -00.0  0E+3  -> 0.0
 782addx730 add -00.   0E+3  -> 0
 783
 784addx732 add  0     0     ->  0
 785addx733 add  0    -0     ->  0
 786addx734 add -0     0     ->  0
 787addx735 add -0    -0     -> -0     -- IEEE 854 special case
 788
 789addx736 add  1    -1     ->  0
 790addx737 add -1    -1     -> -2
 791addx738 add  1     1     ->  2
 792addx739 add -1     1     ->  0
 793
 794addx741 add  0    -1     -> -1
 795addx742 add -0    -1     -> -1
 796addx743 add  0     1     ->  1
 797addx744 add -0     1     ->  1
 798addx745 add -1     0     -> -1
 799addx746 add -1    -0     -> -1
 800addx747 add  1     0     ->  1
 801addx748 add  1    -0     ->  1
 802
 803addx751 add  0.0  -1     -> -1.0
 804addx752 add -0.0  -1     -> -1.0
 805addx753 add  0.0   1     ->  1.0
 806addx754 add -0.0   1     ->  1.0
 807addx755 add -1.0   0     -> -1.0
 808addx756 add -1.0  -0     -> -1.0
 809addx757 add  1.0   0     ->  1.0
 810addx758 add  1.0  -0     ->  1.0
 811
 812addx761 add  0    -1.0   -> -1.0
 813addx762 add -0    -1.0   -> -1.0
 814addx763 add  0     1.0   ->  1.0
 815addx764 add -0     1.0   ->  1.0
 816addx765 add -1     0.0   -> -1.0
 817addx766 add -1    -0.0   -> -1.0
 818addx767 add  1     0.0   ->  1.0
 819addx768 add  1    -0.0   ->  1.0
 820
 821addx771 add  0.0  -1.0   -> -1.0
 822addx772 add -0.0  -1.0   -> -1.0
 823addx773 add  0.0   1.0   ->  1.0
 824addx774 add -0.0   1.0   ->  1.0
 825addx775 add -1.0   0.0   -> -1.0
 826addx776 add -1.0  -0.0   -> -1.0
 827addx777 add  1.0   0.0   ->  1.0
 828addx778 add  1.0  -0.0   ->  1.0
 829
 830-- Specials
 831addx780 add -Inf  -Inf   -> -Infinity
 832addx781 add -Inf  -1000  -> -Infinity
 833addx782 add -Inf  -1     -> -Infinity
 834addx783 add -Inf  -0     -> -Infinity
 835addx784 add -Inf   0     -> -Infinity
 836addx785 add -Inf   1     -> -Infinity
 837addx786 add -Inf   1000  -> -Infinity
 838addx787 add -1000 -Inf   -> -Infinity
 839addx788 add -Inf  -Inf   -> -Infinity
 840addx789 add -1    -Inf   -> -Infinity
 841addx790 add -0    -Inf   -> -Infinity
 842addx791 add  0    -Inf   -> -Infinity
 843addx792 add  1    -Inf   -> -Infinity
 844addx793 add  1000 -Inf   -> -Infinity
 845addx794 add  Inf  -Inf   ->  NaN  Invalid_operation
 846
 847addx800 add  Inf  -Inf   ->  NaN  Invalid_operation
 848addx801 add  Inf  -1000  ->  Infinity
 849addx802 add  Inf  -1     ->  Infinity
 850addx803 add  Inf  -0     ->  Infinity
 851addx804 add  Inf   0     ->  Infinity
 852addx805 add  Inf   1     ->  Infinity
 853addx806 add  Inf   1000  ->  Infinity
 854addx807 add  Inf   Inf   ->  Infinity
 855addx808 add -1000  Inf   ->  Infinity
 856addx809 add -Inf   Inf   ->  NaN  Invalid_operation
 857addx810 add -1     Inf   ->  Infinity
 858addx811 add -0     Inf   ->  Infinity
 859addx812 add  0     Inf   ->  Infinity
 860addx813 add  1     Inf   ->  Infinity
 861addx814 add  1000  Inf   ->  Infinity
 862addx815 add  Inf   Inf   ->  Infinity
 863
 864addx821 add  NaN -Inf    ->  NaN
 865addx822 add  NaN -1000   ->  NaN
 866addx823 add  NaN -1      ->  NaN
 867addx824 add  NaN -0      ->  NaN
 868addx825 add  NaN  0      ->  NaN
 869addx826 add  NaN  1      ->  NaN
 870addx827 add  NaN  1000   ->  NaN
 871addx828 add  NaN  Inf    ->  NaN
 872addx829 add  NaN  NaN    ->  NaN
 873addx830 add -Inf  NaN    ->  NaN
 874addx831 add -1000 NaN    ->  NaN
 875addx832 add -1    NaN    ->  NaN
 876addx833 add -0    NaN    ->  NaN
 877addx834 add  0    NaN    ->  NaN
 878addx835 add  1    NaN    ->  NaN
 879addx836 add  1000 NaN    ->  NaN
 880addx837 add  Inf  NaN    ->  NaN
 881
 882addx841 add  sNaN -Inf   ->  NaN  Invalid_operation
 883addx842 add  sNaN -1000  ->  NaN  Invalid_operation
 884addx843 add  sNaN -1     ->  NaN  Invalid_operation
 885addx844 add  sNaN -0     ->  NaN  Invalid_operation
 886addx845 add  sNaN  0     ->  NaN  Invalid_operation
 887addx846 add  sNaN  1     ->  NaN  Invalid_operation
 888addx847 add  sNaN  1000  ->  NaN  Invalid_operation
 889addx848 add  sNaN  NaN   ->  NaN  Invalid_operation
 890addx849 add  sNaN sNaN   ->  NaN  Invalid_operation
 891addx850 add  NaN  sNaN   ->  NaN  Invalid_operation
 892addx851 add -Inf  sNaN   ->  NaN  Invalid_operation
 893addx852 add -1000 sNaN   ->  NaN  Invalid_operation
 894addx853 add -1    sNaN   ->  NaN  Invalid_operation
 895addx854 add -0    sNaN   ->  NaN  Invalid_operation
 896addx855 add  0    sNaN   ->  NaN  Invalid_operation
 897addx856 add  1    sNaN   ->  NaN  Invalid_operation
 898addx857 add  1000 sNaN   ->  NaN  Invalid_operation
 899addx858 add  Inf  sNaN   ->  NaN  Invalid_operation
 900addx859 add  NaN  sNaN   ->  NaN  Invalid_operation
 901
 902-- propagating NaNs
 903addx861 add  NaN1   -Inf    ->  NaN1
 904addx862 add +NaN2   -1000   ->  NaN2
 905addx863 add  NaN3    1000   ->  NaN3
 906addx864 add  NaN4    Inf    ->  NaN4
 907addx865 add  NaN5   +NaN6   ->  NaN5
 908addx866 add -Inf     NaN7   ->  NaN7
 909addx867 add -1000    NaN8   ->  NaN8
 910addx868 add  1000    NaN9   ->  NaN9
 911addx869 add  Inf    +NaN10  ->  NaN10
 912addx871 add  sNaN11  -Inf   ->  NaN11  Invalid_operation
 913addx872 add  sNaN12  -1000  ->  NaN12  Invalid_operation
 914addx873 add  sNaN13   1000  ->  NaN13  Invalid_operation
 915addx874 add  sNaN14   NaN17 ->  NaN14  Invalid_operation
 916addx875 add  sNaN15  sNaN18 ->  NaN15  Invalid_operation
 917addx876 add  NaN16   sNaN19 ->  NaN19  Invalid_operation
 918addx877 add -Inf    +sNaN20 ->  NaN20  Invalid_operation
 919addx878 add -1000    sNaN21 ->  NaN21  Invalid_operation
 920addx879 add  1000    sNaN22 ->  NaN22  Invalid_operation
 921addx880 add  Inf     sNaN23 ->  NaN23  Invalid_operation
 922addx881 add +NaN25  +sNaN24 ->  NaN24  Invalid_operation
 923addx882 add -NaN26    NaN28 -> -NaN26
 924addx883 add -sNaN27  sNaN29 -> -NaN27  Invalid_operation
 925addx884 add  1000    -NaN30 -> -NaN30
 926addx885 add  1000   -sNaN31 -> -NaN31  Invalid_operation
 927
 928-- overflow, underflow and subnormal tests
 929maxexponent: 999999999
 930minexponent: -999999999
 931precision: 9
 932addx890 add 1E+999999999     9E+999999999   -> Infinity Overflow Inexact Rounded
 933addx891 add 9E+999999999     1E+999999999   -> Infinity Overflow Inexact Rounded
 934addx892 add -1.1E-999999999  1E-999999999   -> -1E-1000000000    Subnormal
 935addx893 add 1E-999999999    -1.1e-999999999 -> -1E-1000000000    Subnormal
 936addx894 add -1.0001E-999999999  1E-999999999   -> -1E-1000000003 Subnormal
 937addx895 add 1E-999999999    -1.0001e-999999999 -> -1E-1000000003 Subnormal
 938addx896 add -1E+999999999   -9E+999999999   -> -Infinity Overflow Inexact Rounded
 939addx897 add -9E+999999999   -1E+999999999   -> -Infinity Overflow Inexact Rounded
 940addx898 add +1.1E-999999999 -1E-999999999   -> 1E-1000000000    Subnormal
 941addx899 add -1E-999999999   +1.1e-999999999 -> 1E-1000000000    Subnormal
 942addx900 add +1.0001E-999999999 -1E-999999999   -> 1E-1000000003 Subnormal
 943addx901 add -1E-999999999   +1.0001e-999999999 -> 1E-1000000003 Subnormal
 944addx902 add -1E+999999999   +9E+999999999   ->  8E+999999999
 945addx903 add -9E+999999999   +1E+999999999   -> -8E+999999999
 946
 947precision: 3
 948addx904 add      0 -9.999E+999999999   -> -Infinity Inexact Overflow Rounded
 949addx905 add        -9.999E+999999999 0 -> -Infinity Inexact Overflow Rounded
 950addx906 add      0  9.999E+999999999   ->  Infinity Inexact Overflow Rounded
 951addx907 add         9.999E+999999999 0 ->  Infinity Inexact Overflow Rounded
 952
 953precision: 3
 954maxexponent: 999
 955minexponent: -999
 956addx910 add  1.00E-999   0    ->   1.00E-999
 957addx911 add  0.1E-999    0    ->   1E-1000   Subnormal
 958addx912 add  0.10E-999   0    ->   1.0E-1000 Subnormal
 959addx913 add  0.100E-999  0    ->   1.0E-1000 Subnormal Rounded
 960addx914 add  0.01E-999   0    ->   1E-1001   Subnormal
 961-- next is rounded to Nmin
 962addx915 add  0.999E-999  0    ->   1.00E-999 Inexact Rounded Subnormal Underflow
 963addx916 add  0.099E-999  0    ->   1.0E-1000 Inexact Rounded Subnormal Underflow
 964addx917 add  0.009E-999  0    ->   1E-1001   Inexact Rounded Subnormal Underflow
 965addx918 add  0.001E-999  0    ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
 966addx919 add  0.0009E-999 0    ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
 967addx920 add  0.0001E-999 0    ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
 968
 969addx930 add -1.00E-999   0    ->  -1.00E-999
 970addx931 add -0.1E-999    0    ->  -1E-1000   Subnormal
 971addx932 add -0.10E-999   0    ->  -1.0E-1000 Subnormal
 972addx933 add -0.100E-999  0    ->  -1.0E-1000 Subnormal Rounded
 973addx934 add -0.01E-999   0    ->  -1E-1001   Subnormal
 974-- next is rounded to Nmin
 975addx935 add -0.999E-999  0    ->  -1.00E-999 Inexact Rounded Subnormal Underflow
 976addx936 add -0.099E-999  0    ->  -1.0E-1000 Inexact Rounded Subnormal Underflow
 977addx937 add -0.009E-999  0    ->  -1E-1001   Inexact Rounded Subnormal Underflow
 978addx938 add -0.001E-999  0    ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped
 979addx939 add -0.0009E-999 0    ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped
 980addx940 add -0.0001E-999 0    ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped
 981
 982-- some non-zero subnormal adds
 983addx950 add  1.00E-999    0.1E-999  ->   1.10E-999
 984addx951 add  0.1E-999     0.1E-999  ->   2E-1000    Subnormal
 985addx952 add  0.10E-999    0.1E-999  ->   2.0E-1000  Subnormal
 986addx953 add  0.100E-999   0.1E-999  ->   2.0E-1000  Subnormal Rounded
 987addx954 add  0.01E-999    0.1E-999  ->   1.1E-1000  Subnormal
 988addx955 add  0.999E-999   0.1E-999  ->   1.10E-999  Inexact Rounded
 989addx956 add  0.099E-999   0.1E-999  ->   2.0E-1000  Inexact Rounded Subnormal Underflow
 990addx957 add  0.009E-999   0.1E-999  ->   1.1E-1000  Inexact Rounded Subnormal Underflow
 991addx958 add  0.001E-999   0.1E-999  ->   1.0E-1000  Inexact Rounded Subnormal Underflow
 992addx959 add  0.0009E-999  0.1E-999  ->   1.0E-1000  Inexact Rounded Subnormal Underflow
 993addx960 add  0.0001E-999  0.1E-999  ->   1.0E-1000  Inexact Rounded Subnormal Underflow
 994-- negatives...
 995addx961 add  1.00E-999   -0.1E-999  ->   9.0E-1000  Subnormal
 996addx962 add  0.1E-999    -0.1E-999  ->   0E-1000
 997addx963 add  0.10E-999   -0.1E-999  ->   0E-1001
 998addx964 add  0.100E-999  -0.1E-999  ->   0E-1001    Clamped
 999addx965 add  0.01E-999   -0.1E-999  ->   -9E-1001   Subnormal
1000addx966 add  0.999E-999  -0.1E-999  ->   9.0E-1000  Inexact Rounded Subnormal Underflow
1001addx967 add  0.099E-999  -0.1E-999  ->   -0E-1001   Inexact Rounded Subnormal Underflow Clamped
1002addx968 add  0.009E-999  -0.1E-999  ->   -9E-1001   Inexact Rounded Subnormal Underflow
1003addx969 add  0.001E-999  -0.1E-999  ->   -1.0E-1000 Inexact Rounded Subnormal Underflow
1004addx970 add  0.0009E-999 -0.1E-999  ->   -1.0E-1000 Inexact Rounded Subnormal Underflow
1005addx971 add  0.0001E-999 -0.1E-999  ->   -1.0E-1000 Inexact Rounded Subnormal Underflow
1006
1007-- some 'real' numbers
1008maxExponent: 384
1009minExponent: -383
1010precision: 8
1011addx566 add 99999061735E-394  0E-394 -> 9.999906E-384 Inexact Rounded Underflow Subnormal
1012precision: 7
1013addx567 add 99999061735E-394  0E-394 -> 9.99991E-384 Inexact Rounded Underflow Subnormal
1014precision: 6
1015addx568 add 99999061735E-394  0E-394 -> 9.9999E-384 Inexact Rounded Underflow Subnormal
1016
1017-- now the case where we can get underflow but the result is normal
1018-- [note this can't happen if the operands are also bounded, as we
1019-- cannot represent 1E-399, for example]
1020precision:   16
1021rounding:    half_up
1022maxExponent: 384
1023minExponent: -383
1024
1025addx571 add       1E-383       0  -> 1E-383
1026addx572 add       1E-384       0  -> 1E-384   Subnormal
1027addx573 add       1E-383  1E-384  -> 1.1E-383
1028addx574 subtract  1E-383  1E-384  ->   9E-384 Subnormal
1029
1030-- Here we explore the boundary of rounding a subnormal to Nmin
1031addx575 subtract  1E-383  1E-398  ->   9.99999999999999E-384  Subnormal
1032addx576 subtract  1E-383  1E-398  ->   9.99999999999999E-384  Subnormal
1033addx577 subtract  1E-383  1E-399  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded
1034addx578 subtract  1E-383  1E-400  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded
1035addx579 subtract  1E-383  1E-401  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded
1036addx580 subtract  1E-383  1E-402  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded
1037
1038-- check overflow edge case
1039precision:   7
1040rounding:    half_up
1041maxExponent: 96
1042minExponent: -95
1043addx972 apply   9.999999E+96         -> 9.999999E+96
1044addx973 add     9.999999E+96  1      -> 9.999999E+96 Inexact Rounded
1045addx974 add      9999999E+90  1      -> 9.999999E+96 Inexact Rounded
1046addx975 add      9999999E+90  1E+90  -> Infinity Overflow Inexact Rounded
1047addx976 add      9999999E+90  9E+89  -> Infinity Overflow Inexact Rounded
1048addx977 add      9999999E+90  8E+89  -> Infinity Overflow Inexact Rounded
1049addx978 add      9999999E+90  7E+89  -> Infinity Overflow Inexact Rounded
1050addx979 add      9999999E+90  6E+89  -> Infinity Overflow Inexact Rounded
1051addx980 add      9999999E+90  5E+89  -> Infinity Overflow Inexact Rounded
1052addx981 add      9999999E+90  4E+89  -> 9.999999E+96 Inexact Rounded
1053addx982 add      9999999E+90  3E+89  -> 9.999999E+96 Inexact Rounded
1054addx983 add      9999999E+90  2E+89  -> 9.999999E+96 Inexact Rounded
1055addx984 add      9999999E+90  1E+89  -> 9.999999E+96 Inexact Rounded
1056
1057addx985 apply  -9.999999E+96         -> -9.999999E+96
1058addx986 add    -9.999999E+96 -1      -> -9.999999E+96 Inexact Rounded
1059addx987 add     -9999999E+90 -1      -> -9.999999E+96 Inexact Rounded
1060addx988 add     -9999999E+90 -1E+90  -> -Infinity Overflow Inexact Rounded
1061addx989 add     -9999999E+90 -9E+89  -> -Infinity Overflow Inexact Rounded
1062addx990 add     -9999999E+90 -8E+89  -> -Infinity Overflow Inexact Rounded
1063addx991 add     -9999999E+90 -7E+89  -> -Infinity Overflow Inexact Rounded
1064addx992 add     -9999999E+90 -6E+89  -> -Infinity Overflow Inexact Rounded
1065addx993 add     -9999999E+90 -5E+89  -> -Infinity Overflow Inexact Rounded
1066addx994 add     -9999999E+90 -4E+89  -> -9.999999E+96 Inexact Rounded
1067addx995 add     -9999999E+90 -3E+89  -> -9.999999E+96 Inexact Rounded
1068addx996 add     -9999999E+90 -2E+89  -> -9.999999E+96 Inexact Rounded
1069addx997 add     -9999999E+90 -1E+89  -> -9.999999E+96 Inexact Rounded
1070
1071-- check for double-rounded subnormals
1072precision:   5
1073maxexponent: 79
1074minexponent: -79
1075-- Add: lhs and rhs 0
1076addx1001 add       1.52444E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow
1077addx1002 add       1.52445E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow
1078addx1003 add       1.52446E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow
1079addx1004 add       0 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnorma…

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