Home | History | Annotate | Download | only in decimaltestdata
      1 ------------------------------------------------------------------------
      2 -- ddRemainderNear.decTest -- decDouble remainder-near                --
      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 (a] uk.ibm.com                                                   --
     19 ------------------------------------------------------------------------
     20 version: 2.59
     21 
     22 precision:   16
     23 maxExponent: 384
     24 minExponent: -383
     25 extended:    1
     26 clamp:       1
     27 rounding:    half_even
     28 
     29 -- sanity checks (as base, above)
     30 ddrmn001 remaindernear  1     1    ->  0
     31 ddrmn002 remaindernear  2     1    ->  0
     32 ddrmn003 remaindernear  1     2    ->  1
     33 ddrmn004 remaindernear  2     2    ->  0
     34 ddrmn005 remaindernear  0     1    ->  0
     35 ddrmn006 remaindernear  0     2    ->  0
     36 ddrmn007 remaindernear  1     3    ->  1
     37 ddrmn008 remaindernear  2     3    -> -1
     38 ddrmn009 remaindernear  3     3    ->  0
     39 
     40 ddrmn010 remaindernear  2.4   1    ->  0.4
     41 ddrmn011 remaindernear  2.4   -1   ->  0.4
     42 ddrmn012 remaindernear  -2.4  1    ->  -0.4
     43 ddrmn013 remaindernear  -2.4  -1   ->  -0.4
     44 ddrmn014 remaindernear  2.40  1    ->  0.40
     45 ddrmn015 remaindernear  2.400 1    ->  0.400
     46 ddrmn016 remaindernear  2.4   2    ->  0.4
     47 ddrmn017 remaindernear  2.400 2    ->  0.400
     48 ddrmn018 remaindernear  2.    2    ->  0
     49 ddrmn019 remaindernear  20    20   ->  0
     50 
     51 ddrmn020 remaindernear  187   187    ->  0
     52 ddrmn021 remaindernear  5     2      ->  1
     53 ddrmn022 remaindernear  5     2.0    ->  1.0
     54 ddrmn023 remaindernear  5     2.000  ->  1.000
     55 ddrmn024 remaindernear  5     0.200  ->  0.000
     56 ddrmn025 remaindernear  5     0.200  ->  0.000
     57 
     58 ddrmn030 remaindernear  1     2      ->  1
     59 ddrmn031 remaindernear  1     4      ->  1
     60 ddrmn032 remaindernear  1     8      ->  1
     61 
     62 ddrmn033 remaindernear  1     16     ->  1
     63 ddrmn034 remaindernear  1     32     ->  1
     64 ddrmn035 remaindernear  1     64     ->  1
     65 ddrmn040 remaindernear  1    -2      ->  1
     66 ddrmn041 remaindernear  1    -4      ->  1
     67 ddrmn042 remaindernear  1    -8      ->  1
     68 ddrmn043 remaindernear  1    -16     ->  1
     69 ddrmn044 remaindernear  1    -32     ->  1
     70 ddrmn045 remaindernear  1    -64     ->  1
     71 ddrmn050 remaindernear -1     2      ->  -1
     72 ddrmn051 remaindernear -1     4      ->  -1
     73 ddrmn052 remaindernear -1     8      ->  -1
     74 ddrmn053 remaindernear -1     16     ->  -1
     75 ddrmn054 remaindernear -1     32     ->  -1
     76 ddrmn055 remaindernear -1     64     ->  -1
     77 ddrmn060 remaindernear -1    -2      ->  -1
     78 ddrmn061 remaindernear -1    -4      ->  -1
     79 ddrmn062 remaindernear -1    -8      ->  -1
     80 ddrmn063 remaindernear -1    -16     ->  -1
     81 ddrmn064 remaindernear -1    -32     ->  -1
     82 ddrmn065 remaindernear -1    -64     ->  -1
     83 
     84 ddrmn066 remaindernear          9.9   1  -> -0.1
     85 ddrmn067 remaindernear         99.7   1  -> -0.3
     86 ddrmn068 remaindernear  999999999     1  -> 0
     87 ddrmn069 remaindernear  999999999.4   1  -> 0.4
     88 ddrmn070 remaindernear  999999999.5   1  -> -0.5
     89 ddrmn071 remaindernear  999999999.9   1  -> -0.1
     90 ddrmn072 remaindernear  999999999.999 1  -> -0.001
     91 ddrmn073 remaindernear  999999.999999 1  -> -0.000001
     92 ddrmn074 remaindernear  9             1  -> 0
     93 ddrmn075 remaindernear  9999999999999999 1  -> 0
     94 ddrmn076 remaindernear  9999999999999999 2  -> -1
     95 ddrmn077 remaindernear  9999999999999999 3  -> 0
     96 ddrmn078 remaindernear  9999999999999999 4  -> -1
     97 
     98 ddrmn080 remaindernear  0.            1  -> 0
     99 ddrmn081 remaindernear  .0            1  -> 0.0
    100 ddrmn082 remaindernear  0.00          1  -> 0.00
    101 ddrmn083 remaindernear  0.00E+9       1  -> 0
    102 ddrmn084 remaindernear  0.00E+3       1  -> 0
    103 ddrmn085 remaindernear  0.00E+2       1  -> 0
    104 ddrmn086 remaindernear  0.00E+1       1  -> 0.0
    105 ddrmn087 remaindernear  0.00E+0       1  -> 0.00
    106 ddrmn088 remaindernear  0.00E-0       1  -> 0.00
    107 ddrmn089 remaindernear  0.00E-1       1  -> 0.000
    108 ddrmn090 remaindernear  0.00E-2       1  -> 0.0000
    109 ddrmn091 remaindernear  0.00E-3       1  -> 0.00000
    110 ddrmn092 remaindernear  0.00E-4       1  -> 0.000000
    111 ddrmn093 remaindernear  0.00E-5       1  -> 0E-7
    112 ddrmn094 remaindernear  0.00E-6       1  -> 0E-8
    113 ddrmn095 remaindernear  0.0000E-50    1  -> 0E-54
    114 
    115 -- Various flavours of remaindernear by 0
    116 ddrmn101 remaindernear  0       0   -> NaN Division_undefined
    117 ddrmn102 remaindernear  0      -0   -> NaN Division_undefined
    118 ddrmn103 remaindernear -0       0   -> NaN Division_undefined
    119 ddrmn104 remaindernear -0      -0   -> NaN Division_undefined
    120 ddrmn105 remaindernear  0.0E5   0   -> NaN Division_undefined
    121 ddrmn106 remaindernear  0.000   0   -> NaN Division_undefined
    122 -- [Some think this next group should be Division_by_zero exception, but
    123 -- IEEE 854 is explicit that it is Invalid operation .. for
    124 -- remainder-near, anyway]
    125 ddrmn107 remaindernear  0.0001  0   -> NaN Invalid_operation
    126 ddrmn108 remaindernear  0.01    0   -> NaN Invalid_operation
    127 ddrmn109 remaindernear  0.1     0   -> NaN Invalid_operation
    128 ddrmn110 remaindernear  1       0   -> NaN Invalid_operation
    129 ddrmn111 remaindernear  1       0.0 -> NaN Invalid_operation
    130 ddrmn112 remaindernear 10       0.0 -> NaN Invalid_operation
    131 ddrmn113 remaindernear 1E+100   0.0 -> NaN Invalid_operation
    132 ddrmn114 remaindernear 1E+380   0   -> NaN Invalid_operation
    133 ddrmn115 remaindernear  0.0001 -0   -> NaN Invalid_operation
    134 ddrmn116 remaindernear  0.01   -0   -> NaN Invalid_operation
    135 ddrmn119 remaindernear  0.1    -0   -> NaN Invalid_operation
    136 ddrmn120 remaindernear  1      -0   -> NaN Invalid_operation
    137 ddrmn121 remaindernear  1      -0.0 -> NaN Invalid_operation
    138 ddrmn122 remaindernear 10      -0.0 -> NaN Invalid_operation
    139 ddrmn123 remaindernear 1E+100  -0.0 -> NaN Invalid_operation
    140 ddrmn124 remaindernear 1E+384  -0   -> NaN Invalid_operation
    141 -- and zeros on left
    142 ddrmn130 remaindernear  0      1   ->  0
    143 ddrmn131 remaindernear  0     -1   ->  0
    144 ddrmn132 remaindernear  0.0    1   ->  0.0
    145 ddrmn133 remaindernear  0.0   -1   ->  0.0
    146 ddrmn134 remaindernear -0      1   -> -0
    147 ddrmn135 remaindernear -0     -1   -> -0
    148 ddrmn136 remaindernear -0.0    1   -> -0.0
    149 ddrmn137 remaindernear -0.0   -1   -> -0.0
    150 
    151 -- 0.5ers
    152 ddrmn143 remaindernear   0.5  2     ->  0.5
    153 ddrmn144 remaindernear   0.5  2.1   ->  0.5
    154 ddrmn145 remaindernear   0.5  2.01  ->  0.50
    155 ddrmn146 remaindernear   0.5  2.001 ->  0.500
    156 ddrmn147 remaindernear   0.50 2     ->  0.50
    157 ddrmn148 remaindernear   0.50 2.01  ->  0.50
    158 ddrmn149 remaindernear   0.50 2.001 ->  0.500
    159 
    160 -- steadies
    161 ddrmn150 remaindernear  1  1   -> 0
    162 ddrmn151 remaindernear  1  2   -> 1
    163 ddrmn152 remaindernear  1  3   -> 1
    164 ddrmn153 remaindernear  1  4   -> 1
    165 ddrmn154 remaindernear  1  5   -> 1
    166 ddrmn155 remaindernear  1  6   -> 1
    167 ddrmn156 remaindernear  1  7   -> 1
    168 ddrmn157 remaindernear  1  8   -> 1
    169 ddrmn158 remaindernear  1  9   -> 1
    170 ddrmn159 remaindernear  1  10  -> 1
    171 ddrmn160 remaindernear  1  1   -> 0
    172 ddrmn161 remaindernear  2  1   -> 0
    173 ddrmn162 remaindernear  3  1   -> 0
    174 ddrmn163 remaindernear  4  1   -> 0
    175 ddrmn164 remaindernear  5  1   -> 0
    176 ddrmn165 remaindernear  6  1   -> 0
    177 ddrmn166 remaindernear  7  1   -> 0
    178 ddrmn167 remaindernear  8  1   -> 0
    179 ddrmn168 remaindernear  9  1   -> 0
    180 ddrmn169 remaindernear  10 1   -> 0
    181 
    182 -- some differences from remainder
    183 ddrmn171 remaindernear   0.4  1.020 ->  0.400
    184 ddrmn172 remaindernear   0.50 1.020 ->  0.500
    185 ddrmn173 remaindernear   0.51 1.020 ->  0.510
    186 ddrmn174 remaindernear   0.52 1.020 -> -0.500
    187 ddrmn175 remaindernear   0.6  1.020 -> -0.420
    188 
    189 -- More flavours of remaindernear by 0
    190 ddrmn201 remaindernear  0      0   -> NaN Division_undefined
    191 ddrmn202 remaindernear  0.0E5  0   -> NaN Division_undefined
    192 ddrmn203 remaindernear  0.000  0   -> NaN Division_undefined
    193 ddrmn204 remaindernear  0.0001 0   -> NaN Invalid_operation
    194 ddrmn205 remaindernear  0.01   0   -> NaN Invalid_operation
    195 ddrmn206 remaindernear  0.1    0   -> NaN Invalid_operation
    196 ddrmn207 remaindernear  1      0   -> NaN Invalid_operation
    197 ddrmn208 remaindernear  1      0.0 -> NaN Invalid_operation
    198 ddrmn209 remaindernear 10      0.0 -> NaN Invalid_operation
    199 ddrmn210 remaindernear 1E+100  0.0 -> NaN Invalid_operation
    200 ddrmn211 remaindernear 1E+380  0   -> NaN Invalid_operation
    201 
    202 -- tests from the extended specification
    203 ddrmn221 remaindernear 2.1     3   -> -0.9
    204 ddrmn222 remaindernear  10     6   -> -2
    205 ddrmn223 remaindernear  10     3   ->  1
    206 ddrmn224 remaindernear -10     3   -> -1
    207 ddrmn225 remaindernear  10.2   1   -> 0.2
    208 ddrmn226 remaindernear  10     0.3 -> 0.1
    209 ddrmn227 remaindernear   3.6   1.3 -> -0.3
    210 
    211 -- some differences from remainder
    212 ddrmn231 remaindernear  -0.4  1.020 -> -0.400
    213 ddrmn232 remaindernear  -0.50 1.020 -> -0.500
    214 ddrmn233 remaindernear  -0.51 1.020 -> -0.510
    215 ddrmn234 remaindernear  -0.52 1.020 ->  0.500
    216 ddrmn235 remaindernear  -0.6  1.020 ->  0.420
    217 
    218 -- high Xs
    219 ddrmn240 remaindernear  1E+2  1.00  ->  0.00
    220 
    221 -- ddrmn3xx are from DiagBigDecimal
    222 ddrmn301 remaindernear   1    3     ->  1
    223 ddrmn302 remaindernear   5    5     ->  0
    224 ddrmn303 remaindernear   13   10    ->  3
    225 ddrmn304 remaindernear   13   50    ->  13
    226 ddrmn305 remaindernear   13   100   ->  13
    227 ddrmn306 remaindernear   13   1000  ->  13
    228 ddrmn307 remaindernear   .13    1   ->  0.13
    229 ddrmn308 remaindernear   0.133  1   ->  0.133
    230 ddrmn309 remaindernear   0.1033 1   ->  0.1033
    231 ddrmn310 remaindernear   1.033  1   ->  0.033
    232 ddrmn311 remaindernear   10.33  1   ->  0.33
    233 ddrmn312 remaindernear   10.33 10   ->  0.33
    234 ddrmn313 remaindernear   103.3  1   ->  0.3
    235 ddrmn314 remaindernear   133   10   ->  3
    236 ddrmn315 remaindernear   1033  10   ->  3
    237 ddrmn316 remaindernear   1033  50   -> -17
    238 ddrmn317 remaindernear   101.0  3   -> -1.0
    239 ddrmn318 remaindernear   102.0  3   ->  0.0
    240 ddrmn319 remaindernear   103.0  3   ->  1.0
    241 ddrmn320 remaindernear   2.40   1   ->  0.40
    242 ddrmn321 remaindernear   2.400  1   ->  0.400
    243 ddrmn322 remaindernear   2.4    1   ->  0.4
    244 ddrmn323 remaindernear   2.4    2   ->  0.4
    245 ddrmn324 remaindernear   2.400  2   ->  0.400
    246 ddrmn325 remaindernear   1   0.3    ->  0.1
    247 ddrmn326 remaindernear   1   0.30   ->  0.10
    248 ddrmn327 remaindernear   1   0.300  ->  0.100
    249 ddrmn328 remaindernear   1   0.3000 ->  0.1000
    250 ddrmn329 remaindernear   1.0    0.3 ->  0.1
    251 ddrmn330 remaindernear   1.00   0.3 ->  0.10
    252 ddrmn331 remaindernear   1.000  0.3 ->  0.100
    253 ddrmn332 remaindernear   1.0000 0.3 ->  0.1000
    254 ddrmn333 remaindernear   0.5  2     ->  0.5
    255 ddrmn334 remaindernear   0.5  2.1   ->  0.5
    256 ddrmn335 remaindernear   0.5  2.01  ->  0.50
    257 ddrmn336 remaindernear   0.5  2.001 ->  0.500
    258 ddrmn337 remaindernear   0.50 2     ->  0.50
    259 ddrmn338 remaindernear   0.50 2.01  ->  0.50
    260 ddrmn339 remaindernear   0.50 2.001 ->  0.500
    261 
    262 ddrmn340 remaindernear   0.5   0.5000001    ->  -1E-7
    263 ddrmn341 remaindernear   0.5   0.50000001    ->  -1E-8
    264 ddrmn342 remaindernear   0.5   0.500000001    ->  -1E-9
    265 ddrmn343 remaindernear   0.5   0.5000000001    ->  -1E-10
    266 ddrmn344 remaindernear   0.5   0.50000000001    ->  -1E-11
    267 ddrmn345 remaindernear   0.5   0.4999999    ->  1E-7
    268 ddrmn346 remaindernear   0.5   0.49999999    ->  1E-8
    269 ddrmn347 remaindernear   0.5   0.499999999    ->  1E-9
    270 ddrmn348 remaindernear   0.5   0.4999999999    ->  1E-10
    271 ddrmn349 remaindernear   0.5   0.49999999999    ->  1E-11
    272 ddrmn350 remaindernear   0.5   0.499999999999    ->  1E-12
    273 
    274 ddrmn351 remaindernear   0.03  7  ->  0.03
    275 ddrmn352 remaindernear   5   2    ->  1
    276 ddrmn353 remaindernear   4.1   2    ->  0.1
    277 ddrmn354 remaindernear   4.01   2    ->  0.01
    278 ddrmn355 remaindernear   4.001   2    ->  0.001
    279 ddrmn356 remaindernear   4.0001   2    ->  0.0001
    280 ddrmn357 remaindernear   4.00001   2    ->  0.00001
    281 ddrmn358 remaindernear   4.000001   2    ->  0.000001
    282 ddrmn359 remaindernear   4.0000001   2    ->  1E-7
    283 
    284 ddrmn360 remaindernear   1.2   0.7345 -> -0.2690
    285 ddrmn361 remaindernear   0.8   12     ->  0.8
    286 ddrmn362 remaindernear   0.8   0.2    ->  0.0
    287 ddrmn363 remaindernear   0.8   0.3    -> -0.1
    288 ddrmn364 remaindernear   0.800   12   ->  0.800
    289 ddrmn365 remaindernear   0.800   1.7  ->  0.800
    290 ddrmn366 remaindernear   2.400   2    ->  0.400
    291 
    292 -- round to even
    293 ddrmn371 remaindernear   121     2    ->  1
    294 ddrmn372 remaindernear   122     2    ->  0
    295 ddrmn373 remaindernear   123     2    -> -1
    296 ddrmn374 remaindernear   124     2    ->  0
    297 ddrmn375 remaindernear   125     2    ->  1
    298 ddrmn376 remaindernear   126     2    ->  0
    299 ddrmn377 remaindernear   127     2    -> -1
    300 
    301 ddrmn381 remaindernear 12345  1         ->  0
    302 ddrmn382 remaindernear 12345  1.0001    -> -0.2344
    303 ddrmn383 remaindernear 12345  1.001     -> -0.333
    304 ddrmn384 remaindernear 12345  1.01      -> -0.23
    305 ddrmn385 remaindernear 12345  1.1       -> -0.3
    306 ddrmn386 remaindernear 12355  4         -> -1
    307 ddrmn387 remaindernear 12345  4         ->  1
    308 ddrmn388 remaindernear 12355  4.0001    -> -1.3089
    309 ddrmn389 remaindernear 12345  4.0001    ->  0.6914
    310 ddrmn390 remaindernear 12345  4.9       ->  1.9
    311 ddrmn391 remaindernear 12345  4.99      -> -0.26
    312 ddrmn392 remaindernear 12345  4.999     ->  2.469
    313 ddrmn393 remaindernear 12345  4.9999    ->  0.2469
    314 ddrmn394 remaindernear 12345  5         ->  0
    315 ddrmn395 remaindernear 12345  5.0001    -> -0.2469
    316 ddrmn396 remaindernear 12345  5.001     -> -2.469
    317 ddrmn397 remaindernear 12345  5.01      ->  0.36
    318 ddrmn398 remaindernear 12345  5.1       -> -2.1
    319 
    320 -- the nasty division-by-1 cases
    321 ddrmn401 remaindernear   0.4         1   ->  0.4
    322 ddrmn402 remaindernear   0.45        1   ->  0.45
    323 ddrmn403 remaindernear   0.455       1   ->  0.455
    324 ddrmn404 remaindernear   0.4555      1   ->  0.4555
    325 ddrmn405 remaindernear   0.45555     1   ->  0.45555
    326 ddrmn406 remaindernear   0.455555    1   ->  0.455555
    327 ddrmn407 remaindernear   0.4555555   1   ->  0.4555555
    328 ddrmn408 remaindernear   0.45555555  1   ->  0.45555555
    329 ddrmn409 remaindernear   0.455555555 1   ->  0.455555555
    330 -- with spill... [412 exercises sticktab loop]
    331 ddrmn411 remaindernear   0.5         1   ->  0.5
    332 ddrmn412 remaindernear   0.55        1   -> -0.45
    333 ddrmn413 remaindernear   0.555       1   -> -0.445
    334 ddrmn414 remaindernear   0.5555      1   -> -0.4445
    335 ddrmn415 remaindernear   0.55555     1   -> -0.44445
    336 ddrmn416 remaindernear   0.555555    1   -> -0.444445
    337 ddrmn417 remaindernear   0.5555555   1   -> -0.4444445
    338 ddrmn418 remaindernear   0.55555555  1   -> -0.44444445
    339 ddrmn419 remaindernear   0.555555555 1   -> -0.444444445
    340 
    341 -- folddowns
    342 ddrmn421 remaindernear   1E+384       1  ->   NaN Division_impossible
    343 ddrmn422 remaindernear   1E+384  1E+383  ->   0E+369 Clamped
    344 ddrmn423 remaindernear   1E+384  2E+383  ->   0E+369 Clamped
    345 ddrmn424 remaindernear   1E+384  3E+383  ->   1.00000000000000E+383 Clamped
    346 ddrmn425 remaindernear   1E+384  4E+383  ->   2.00000000000000E+383 Clamped
    347 ddrmn426 remaindernear   1E+384  5E+383  ->   0E+369 Clamped
    348 ddrmn427 remaindernear   1E+384  6E+383  ->  -2.00000000000000E+383 Clamped
    349 ddrmn428 remaindernear   1E+384  7E+383  ->   3.00000000000000E+383 Clamped
    350 ddrmn429 remaindernear   1E+384  8E+383  ->   2.00000000000000E+383 Clamped
    351 ddrmn430 remaindernear   1E+384  9E+383  ->   1.00000000000000E+383 Clamped
    352 -- tinies
    353 ddrmn431 remaindernear   1E-397  1E-398  ->   0E-398
    354 ddrmn432 remaindernear   1E-397  2E-398  ->   0E-398
    355 ddrmn433 remaindernear   1E-397  3E-398  ->   1E-398 Subnormal
    356 ddrmn434 remaindernear   1E-397  4E-398  ->   2E-398 Subnormal
    357 ddrmn435 remaindernear   1E-397  5E-398  ->   0E-398
    358 ddrmn436 remaindernear   1E-397  6E-398  ->  -2E-398 Subnormal
    359 ddrmn437 remaindernear   1E-397  7E-398  ->   3E-398 Subnormal
    360 ddrmn438 remaindernear   1E-397  8E-398  ->   2E-398 Subnormal
    361 ddrmn439 remaindernear   1E-397  9E-398  ->   1E-398 Subnormal
    362 ddrmn440 remaindernear   1E-397 10E-398  ->   0E-398
    363 ddrmn441 remaindernear   1E-397 11E-398  ->  -1E-398 Subnormal
    364 ddrmn442 remaindernear 100E-397 11E-398  ->  -1E-398 Subnormal
    365 ddrmn443 remaindernear 100E-397 20E-398  ->   0E-398
    366 ddrmn444 remaindernear 100E-397 21E-398  ->  -8E-398 Subnormal
    367 ddrmn445 remaindernear 100E-397 30E-398  -> 1.0E-397 Subnormal
    368 
    369 -- zero signs
    370 ddrmn650 remaindernear  1  1 ->  0
    371 ddrmn651 remaindernear -1  1 -> -0
    372 ddrmn652 remaindernear  1 -1 ->  0
    373 ddrmn653 remaindernear -1 -1 -> -0
    374 ddrmn654 remaindernear  0  1 ->  0
    375 ddrmn655 remaindernear -0  1 -> -0
    376 ddrmn656 remaindernear  0 -1 ->  0
    377 ddrmn657 remaindernear -0 -1 -> -0
    378 ddrmn658 remaindernear  0.00  1  ->  0.00
    379 ddrmn659 remaindernear -0.00  1  -> -0.00
    380 
    381 -- Specials
    382 ddrmn680 remaindernear  Inf  -Inf   ->  NaN Invalid_operation
    383 ddrmn681 remaindernear  Inf  -1000  ->  NaN Invalid_operation
    384 ddrmn682 remaindernear  Inf  -1     ->  NaN Invalid_operation
    385 ddrmn683 remaindernear  Inf   0     ->  NaN Invalid_operation
    386 ddrmn684 remaindernear  Inf  -0     ->  NaN Invalid_operation
    387 ddrmn685 remaindernear  Inf   1     ->  NaN Invalid_operation
    388 ddrmn686 remaindernear  Inf   1000  ->  NaN Invalid_operation
    389 ddrmn687 remaindernear  Inf   Inf   ->  NaN Invalid_operation
    390 ddrmn688 remaindernear -1000  Inf   -> -1000
    391 ddrmn689 remaindernear -Inf   Inf   ->  NaN Invalid_operation
    392 ddrmn691 remaindernear -1     Inf   -> -1
    393 ddrmn692 remaindernear  0     Inf   ->  0
    394 ddrmn693 remaindernear -0     Inf   -> -0
    395 ddrmn694 remaindernear  1     Inf   ->  1
    396 ddrmn695 remaindernear  1000  Inf   ->  1000
    397 ddrmn696 remaindernear  Inf   Inf   ->  NaN Invalid_operation
    398 
    399 ddrmn700 remaindernear -Inf  -Inf   ->  NaN Invalid_operation
    400 ddrmn701 remaindernear -Inf  -1000  ->  NaN Invalid_operation
    401 ddrmn702 remaindernear -Inf  -1     ->  NaN Invalid_operation
    402 ddrmn703 remaindernear -Inf  -0     ->  NaN Invalid_operation
    403 ddrmn704 remaindernear -Inf   0     ->  NaN Invalid_operation
    404 ddrmn705 remaindernear -Inf   1     ->  NaN Invalid_operation
    405 ddrmn706 remaindernear -Inf   1000  ->  NaN Invalid_operation
    406 ddrmn707 remaindernear -Inf   Inf   ->  NaN Invalid_operation
    407 ddrmn708 remaindernear -Inf  -Inf   ->  NaN Invalid_operation
    408 ddrmn709 remaindernear -1000  Inf   -> -1000
    409 ddrmn710 remaindernear -1    -Inf   -> -1
    410 ddrmn711 remaindernear -0    -Inf   -> -0
    411 ddrmn712 remaindernear  0    -Inf   ->  0
    412 ddrmn713 remaindernear  1    -Inf   ->  1
    413 ddrmn714 remaindernear  1000 -Inf   ->  1000
    414 ddrmn715 remaindernear  Inf  -Inf   ->  NaN Invalid_operation
    415 
    416 ddrmn721 remaindernear  NaN -Inf    ->  NaN
    417 ddrmn722 remaindernear  NaN -1000   ->  NaN
    418 ddrmn723 remaindernear  NaN -1      ->  NaN
    419 ddrmn724 remaindernear  NaN -0      ->  NaN
    420 ddrmn725 remaindernear -NaN  0      -> -NaN
    421 ddrmn726 remaindernear  NaN  1      ->  NaN
    422 ddrmn727 remaindernear  NaN  1000   ->  NaN
    423 ddrmn728 remaindernear  NaN  Inf    ->  NaN
    424 ddrmn729 remaindernear  NaN -NaN    ->  NaN
    425 ddrmn730 remaindernear -Inf  NaN    ->  NaN
    426 ddrmn731 remaindernear -1000 NaN    ->  NaN
    427 ddrmn732 remaindernear -1    NaN    ->  NaN
    428 ddrmn733 remaindernear -0   -NaN    -> -NaN
    429 ddrmn734 remaindernear  0    NaN    ->  NaN
    430 ddrmn735 remaindernear  1   -NaN    -> -NaN
    431 ddrmn736 remaindernear  1000 NaN    ->  NaN
    432 ddrmn737 remaindernear  Inf  NaN    ->  NaN
    433 
    434 ddrmn741 remaindernear  sNaN -Inf   ->  NaN  Invalid_operation
    435 ddrmn742 remaindernear  sNaN -1000  ->  NaN  Invalid_operation
    436 ddrmn743 remaindernear -sNaN -1     -> -NaN  Invalid_operation
    437 ddrmn744 remaindernear  sNaN -0     ->  NaN  Invalid_operation
    438 ddrmn745 remaindernear  sNaN  0     ->  NaN  Invalid_operation
    439 ddrmn746 remaindernear  sNaN  1     ->  NaN  Invalid_operation
    440 ddrmn747 remaindernear  sNaN  1000  ->  NaN  Invalid_operation
    441 ddrmn749 remaindernear  sNaN  NaN   ->  NaN  Invalid_operation
    442 ddrmn750 remaindernear  sNaN sNaN   ->  NaN  Invalid_operation
    443 ddrmn751 remaindernear  NaN  sNaN   ->  NaN  Invalid_operation
    444 ddrmn752 remaindernear -Inf  sNaN   ->  NaN  Invalid_operation
    445 ddrmn753 remaindernear -1000 sNaN   ->  NaN  Invalid_operation
    446 ddrmn754 remaindernear -1    sNaN   ->  NaN  Invalid_operation
    447 ddrmn755 remaindernear -0    sNaN   ->  NaN  Invalid_operation
    448 ddrmn756 remaindernear  0    sNaN   ->  NaN  Invalid_operation
    449 ddrmn757 remaindernear  1    sNaN   ->  NaN  Invalid_operation
    450 ddrmn758 remaindernear  1000 sNaN   ->  NaN  Invalid_operation
    451 ddrmn759 remaindernear  Inf -sNaN   -> -NaN  Invalid_operation
    452 
    453 -- propaging NaNs
    454 ddrmn760 remaindernear  NaN1   NaN7   ->  NaN1
    455 ddrmn761 remaindernear sNaN2   NaN8   ->  NaN2 Invalid_operation
    456 ddrmn762 remaindernear  NaN3  sNaN9   ->  NaN9 Invalid_operation
    457 ddrmn763 remaindernear sNaN4  sNaN10  ->  NaN4 Invalid_operation
    458 ddrmn764 remaindernear    15   NaN11  ->  NaN11
    459 ddrmn765 remaindernear  NaN6   NaN12  ->  NaN6
    460 ddrmn766 remaindernear  Inf    NaN13  ->  NaN13
    461 ddrmn767 remaindernear  NaN14  -Inf   ->  NaN14
    462 ddrmn768 remaindernear    0    NaN15  ->  NaN15
    463 ddrmn769 remaindernear  NaN16   -0    ->  NaN16
    464 
    465 -- edge cases of impossible
    466 ddrmn770  remaindernear  1234567890123456  10    -> -4
    467 ddrmn771  remaindernear  1234567890123456   1    ->  0
    468 ddrmn772  remaindernear  1234567890123456   0.1  ->  NaN Division_impossible
    469 ddrmn773  remaindernear  1234567890123456   0.01 ->  NaN Division_impossible
    470 
    471 -- long operand checks
    472 ddrmn801 remaindernear 12345678000 100 -> 0
    473 ddrmn802 remaindernear 1 12345678000   -> 1
    474 ddrmn803 remaindernear 1234567800  10  -> 0
    475 ddrmn804 remaindernear 1 1234567800    -> 1
    476 ddrmn805 remaindernear 1234567890  10  -> 0
    477 ddrmn806 remaindernear 1 1234567890    -> 1
    478 ddrmn807 remaindernear 1234567891  10  -> 1
    479 ddrmn808 remaindernear 1 1234567891    -> 1
    480 ddrmn809 remaindernear 12345678901 100 -> 1
    481 ddrmn810 remaindernear 1 12345678901   -> 1
    482 ddrmn811 remaindernear 1234567896  10  -> -4
    483 ddrmn812 remaindernear 1 1234567896    -> 1
    484 
    485 ddrmn821 remaindernear 12345678000 100 -> 0
    486 ddrmn822 remaindernear 1 12345678000   -> 1
    487 ddrmn823 remaindernear 1234567800  10  -> 0
    488 ddrmn824 remaindernear 1 1234567800    -> 1
    489 ddrmn825 remaindernear 1234567890  10  -> 0
    490 ddrmn826 remaindernear 1 1234567890    -> 1
    491 ddrmn827 remaindernear 1234567891  10  -> 1
    492 ddrmn828 remaindernear 1 1234567891    -> 1
    493 ddrmn829 remaindernear 12345678901 100 -> 1
    494 ddrmn830 remaindernear 1 12345678901   -> 1
    495 ddrmn831 remaindernear 1234567896  10  -> -4
    496 ddrmn832 remaindernear 1 1234567896    -> 1
    497 
    498 -- from divideint
    499 ddrmn840 remaindernear  100000000.0   1  ->  0.0
    500 ddrmn841 remaindernear  100000000.4   1  ->  0.4
    501 ddrmn842 remaindernear  100000000.5   1  ->  0.5
    502 ddrmn843 remaindernear  100000000.9   1  -> -0.1
    503 ddrmn844 remaindernear  100000000.999 1  -> -0.001
    504 ddrmn850 remaindernear  100000003     5  -> -2
    505 ddrmn851 remaindernear  10000003      5  -> -2
    506 ddrmn852 remaindernear  1000003       5  -> -2
    507 ddrmn853 remaindernear  100003        5  -> -2
    508 ddrmn854 remaindernear  10003         5  -> -2
    509 ddrmn855 remaindernear  1003          5  -> -2
    510 ddrmn856 remaindernear  103           5  -> -2
    511 ddrmn857 remaindernear  13            5  -> -2
    512 ddrmn858 remaindernear  1             5  ->  1
    513 
    514 -- Vladimir's cases         1234567890123456
    515 ddrmn860 remaindernear 123.0e1 1000000000000000  -> 1230
    516 ddrmn861 remaindernear 1230    1000000000000000  -> 1230
    517 ddrmn862 remaindernear 12.3e2  1000000000000000  -> 1230
    518 ddrmn863 remaindernear 1.23e3  1000000000000000  -> 1230
    519 ddrmn864 remaindernear 123e1   1000000000000000  -> 1230
    520 ddrmn870 remaindernear 123e1    1000000000000000 -> 1230
    521 ddrmn871 remaindernear 123e1     100000000000000 -> 1230
    522 ddrmn872 remaindernear 123e1      10000000000000 -> 1230
    523 ddrmn873 remaindernear 123e1       1000000000000 -> 1230
    524 ddrmn874 remaindernear 123e1        100000000000 -> 1230
    525 ddrmn875 remaindernear 123e1         10000000000 -> 1230
    526 ddrmn876 remaindernear 123e1          1000000000 -> 1230
    527 ddrmn877 remaindernear 123e1           100000000 -> 1230
    528 ddrmn878 remaindernear 1230            100000000 -> 1230
    529 ddrmn879 remaindernear 123e1            10000000 -> 1230
    530 ddrmn880 remaindernear 123e1             1000000 -> 1230
    531 ddrmn881 remaindernear 123e1              100000 -> 1230
    532 ddrmn882 remaindernear 123e1               10000 -> 1230
    533 ddrmn883 remaindernear 123e1                1000 ->  230
    534 ddrmn884 remaindernear 123e1                 100 ->   30
    535 ddrmn885 remaindernear 123e1                  10 ->    0
    536 ddrmn886 remaindernear 123e1                   1 ->    0
    537 
    538 ddrmn890 remaindernear 123e1    2000000000000000 -> 1230
    539 ddrmn891 remaindernear 123e1     200000000000000 -> 1230
    540 ddrmn892 remaindernear 123e1      20000000000000 -> 1230
    541 ddrmn893 remaindernear 123e1       2000000000000 -> 1230
    542 ddrmn894 remaindernear 123e1        200000000000 -> 1230
    543 ddrmn895 remaindernear 123e1         20000000000 -> 1230
    544 ddrmn896 remaindernear 123e1          2000000000 -> 1230
    545 ddrmn897 remaindernear 123e1           200000000 -> 1230
    546 ddrmn899 remaindernear 123e1            20000000 -> 1230
    547 ddrmn900 remaindernear 123e1             2000000 -> 1230
    548 ddrmn901 remaindernear 123e1              200000 -> 1230
    549 ddrmn902 remaindernear 123e1               20000 -> 1230
    550 ddrmn903 remaindernear 123e1                2000 -> -770
    551 ddrmn904 remaindernear 123e1                 200 ->   30
    552 ddrmn905 remaindernear 123e1                  20 ->  -10
    553 ddrmn906 remaindernear 123e1                   2 ->    0
    554 
    555 ddrmn910 remaindernear 123e1    5000000000000000 -> 1230
    556 ddrmn911 remaindernear 123e1     500000000000000 -> 1230
    557 ddrmn912 remaindernear 123e1      50000000000000 -> 1230
    558 ddrmn913 remaindernear 123e1       5000000000000 -> 1230
    559 ddrmn914 remaindernear 123e1        500000000000 -> 1230
    560 ddrmn915 remaindernear 123e1         50000000000 -> 1230
    561 ddrmn916 remaindernear 123e1          5000000000 -> 1230
    562 ddrmn917 remaindernear 123e1           500000000 -> 1230
    563 ddrmn919 remaindernear 123e1            50000000 -> 1230
    564 ddrmn920 remaindernear 123e1             5000000 -> 1230
    565 ddrmn921 remaindernear 123e1              500000 -> 1230
    566 ddrmn922 remaindernear 123e1               50000 -> 1230
    567 ddrmn923 remaindernear 123e1                5000 -> 1230
    568 ddrmn924 remaindernear 123e1                 500 ->  230
    569 ddrmn925 remaindernear 123e1                  50 ->  -20
    570 ddrmn926 remaindernear 123e1                   5 ->    0
    571 
    572 ddrmn930 remaindernear 123e1    9000000000000000 -> 1230
    573 ddrmn931 remaindernear 123e1     900000000000000 -> 1230
    574 ddrmn932 remaindernear 123e1      90000000000000 -> 1230
    575 ddrmn933 remaindernear 123e1       9000000000000 -> 1230
    576 ddrmn934 remaindernear 123e1        900000000000 -> 1230
    577 ddrmn935 remaindernear 123e1         90000000000 -> 1230
    578 ddrmn936 remaindernear 123e1          9000000000 -> 1230
    579 ddrmn937 remaindernear 123e1           900000000 -> 1230
    580 ddrmn939 remaindernear 123e1            90000000 -> 1230
    581 ddrmn940 remaindernear 123e1             9000000 -> 1230
    582 ddrmn941 remaindernear 123e1              900000 -> 1230
    583 ddrmn942 remaindernear 123e1               90000 -> 1230
    584 ddrmn943 remaindernear 123e1                9000 -> 1230
    585 ddrmn944 remaindernear 123e1                 900 ->  330
    586 ddrmn945 remaindernear 123e1                  90 ->  -30
    587 ddrmn946 remaindernear 123e1                   9 ->   -3
    588 
    589 ddrmn950 remaindernear 123e1   1000000000000000 -> 1230
    590 ddrmn961 remaindernear 123e1   2999999999999999 -> 1230
    591 ddrmn962 remaindernear 123e1   3999999999999999 -> 1230
    592 ddrmn963 remaindernear 123e1   4999999999999999 -> 1230
    593 ddrmn964 remaindernear 123e1   5999999999999999 -> 1230
    594 ddrmn965 remaindernear 123e1   6999999999999999 -> 1230
    595 ddrmn966 remaindernear 123e1   7999999999999999 -> 1230
    596 ddrmn967 remaindernear 123e1   8999999999999999 -> 1230
    597 ddrmn968 remaindernear 123e1   9999999999999999 -> 1230
    598 ddrmn969 remaindernear 123e1   9876543210987654 -> 1230
    599 
    600 ddrmn980 remaindernear 123e1 1000E299 -> 1.23E+3  -- 123E+1 internally
    601 
    602 
    603 -- overflow and underflow tests [from divide]
    604 ddrmn1051 remaindernear  1e+277  1e-311 ->  NaN Division_impossible
    605 ddrmn1052 remaindernear  1e+277 -1e-311 ->  NaN Division_impossible
    606 ddrmn1053 remaindernear -1e+277  1e-311 ->  NaN Division_impossible
    607 ddrmn1054 remaindernear -1e+277 -1e-311 ->  NaN Division_impossible
    608 ddrmn1055 remaindernear  1e-277  1e+311 ->  1E-277
    609 ddrmn1056 remaindernear  1e-277 -1e+311 ->  1E-277
    610 ddrmn1057 remaindernear -1e-277  1e+311 -> -1E-277
    611 ddrmn1058 remaindernear -1e-277 -1e+311 -> -1E-277
    612 
    613 -- destructive subtract
    614 ddrmn1100 remainderNear  1234567890123456  1.000000000000001  ->  -0.234567890123455
    615 ddrmn1101 remainderNear  1234567890123456   1.00000000000001  ->   -0.34567890123444
    616 ddrmn1102 remainderNear  1234567890123456    1.0000000000001  ->    -0.4567890123333
    617 ddrmn1103 remainderNear  1234567890123455  4.000000000000001  ->  -1.308641972530864
    618 ddrmn1104 remainderNear  1234567890123456  4.000000000000001  ->  -0.308641972530864
    619 ddrmn1115 remainderNear  1234567890123456    4.9999999999999  ->     0.6913578024696
    620 ddrmn1116 remainderNear  1234567890123456   4.99999999999999  ->   -1.53086421975308
    621 ddrmn1117 remainderNear  1234567890123456  4.999999999999999  ->   1.246913578024691
    622 ddrmn1118 remainderNear  1234567890123456  5.000000000000001  ->   0.753086421975309
    623 ddrmn1119 remainderNear  1234567890123456   5.00000000000001  ->   -1.46913578024691
    624 ddrmn1110 remainderNear  1234567890123456    5.0000000000001  ->     1.3086421975314
    625 
    626 -- Null tests
    627 ddrmn1000 remaindernear 10  # -> NaN Invalid_operation
    628 ddrmn1001 remaindernear  # 10 -> NaN Invalid_operation
    629 
    630