1------------------------------------------------------------------------ 2-- dqRemainderNear.decTest -- decQuad 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@uk.ibm.com -- 19------------------------------------------------------------------------ 20version: 2.59 21 22extended: 1 23clamp: 1 24precision: 34 25maxExponent: 6144 26minExponent: -6143 27rounding: half_even 28 29-- sanity checks (as base, above) 30dqrmn001 remaindernear 1 1 -> 0 31dqrmn002 remaindernear 2 1 -> 0 32dqrmn003 remaindernear 1 2 -> 1 33dqrmn004 remaindernear 2 2 -> 0 34dqrmn005 remaindernear 0 1 -> 0 35dqrmn006 remaindernear 0 2 -> 0 36dqrmn007 remaindernear 1 3 -> 1 37dqrmn008 remaindernear 2 3 -> -1 38dqrmn009 remaindernear 3 3 -> 0 39 40dqrmn010 remaindernear 2.4 1 -> 0.4 41dqrmn011 remaindernear 2.4 -1 -> 0.4 42dqrmn012 remaindernear -2.4 1 -> -0.4 43dqrmn013 remaindernear -2.4 -1 -> -0.4 44dqrmn014 remaindernear 2.40 1 -> 0.40 45dqrmn015 remaindernear 2.400 1 -> 0.400 46dqrmn016 remaindernear 2.4 2 -> 0.4 47dqrmn017 remaindernear 2.400 2 -> 0.400 48dqrmn018 remaindernear 2. 2 -> 0 49dqrmn019 remaindernear 20 20 -> 0 50 51dqrmn020 remaindernear 187 187 -> 0 52dqrmn021 remaindernear 5 2 -> 1 53dqrmn022 remaindernear 5 2.0 -> 1.0 54dqrmn023 remaindernear 5 2.000 -> 1.000 55dqrmn024 remaindernear 5 0.200 -> 0.000 56dqrmn025 remaindernear 5 0.200 -> 0.000 57 58dqrmn030 remaindernear 1 2 -> 1 59dqrmn031 remaindernear 1 4 -> 1 60dqrmn032 remaindernear 1 8 -> 1 61 62dqrmn033 remaindernear 1 16 -> 1 63dqrmn034 remaindernear 1 32 -> 1 64dqrmn035 remaindernear 1 64 -> 1 65dqrmn040 remaindernear 1 -2 -> 1 66dqrmn041 remaindernear 1 -4 -> 1 67dqrmn042 remaindernear 1 -8 -> 1 68dqrmn043 remaindernear 1 -16 -> 1 69dqrmn044 remaindernear 1 -32 -> 1 70dqrmn045 remaindernear 1 -64 -> 1 71dqrmn050 remaindernear -1 2 -> -1 72dqrmn051 remaindernear -1 4 -> -1 73dqrmn052 remaindernear -1 8 -> -1 74dqrmn053 remaindernear -1 16 -> -1 75dqrmn054 remaindernear -1 32 -> -1 76dqrmn055 remaindernear -1 64 -> -1 77dqrmn060 remaindernear -1 -2 -> -1 78dqrmn061 remaindernear -1 -4 -> -1 79dqrmn062 remaindernear -1 -8 -> -1 80dqrmn063 remaindernear -1 -16 -> -1 81dqrmn064 remaindernear -1 -32 -> -1 82dqrmn065 remaindernear -1 -64 -> -1 83 84dqrmn066 remaindernear 9.9 1 -> -0.1 85dqrmn067 remaindernear 99.7 1 -> -0.3 86dqrmn068 remaindernear 999999999 1 -> 0 87dqrmn069 remaindernear 999999999.4 1 -> 0.4 88dqrmn070 remaindernear 999999999.5 1 -> -0.5 89dqrmn071 remaindernear 999999999.9 1 -> -0.1 90dqrmn072 remaindernear 999999999.999 1 -> -0.001 91dqrmn073 remaindernear 999999.999999 1 -> -0.000001 92dqrmn074 remaindernear 9 1 -> 0 93dqrmn075 remaindernear 9999999999999999 1 -> 0 94dqrmn076 remaindernear 9999999999999999 2 -> -1 95dqrmn077 remaindernear 9999999999999999 3 -> 0 96dqrmn078 remaindernear 9999999999999999 4 -> -1 97 98dqrmn080 remaindernear 0. 1 -> 0 99dqrmn081 remaindernear .0 1 -> 0.0 100dqrmn082 remaindernear 0.00 1 -> 0.00 101dqrmn083 remaindernear 0.00E+9 1 -> 0 102dqrmn084 remaindernear 0.00E+3 1 -> 0 103dqrmn085 remaindernear 0.00E+2 1 -> 0 104dqrmn086 remaindernear 0.00E+1 1 -> 0.0 105dqrmn087 remaindernear 0.00E+0 1 -> 0.00 106dqrmn088 remaindernear 0.00E-0 1 -> 0.00 107dqrmn089 remaindernear 0.00E-1 1 -> 0.000 108dqrmn090 remaindernear 0.00E-2 1 -> 0.0000 109dqrmn091 remaindernear 0.00E-3 1 -> 0.00000 110dqrmn092 remaindernear 0.00E-4 1 -> 0.000000 111dqrmn093 remaindernear 0.00E-5 1 -> 0E-7 112dqrmn094 remaindernear 0.00E-6 1 -> 0E-8 113dqrmn095 remaindernear 0.0000E-50 1 -> 0E-54 114 115-- Various flavours of remaindernear by 0 116dqrmn101 remaindernear 0 0 -> NaN Division_undefined 117dqrmn102 remaindernear 0 -0 -> NaN Division_undefined 118dqrmn103 remaindernear -0 0 -> NaN Division_undefined 119dqrmn104 remaindernear -0 -0 -> NaN Division_undefined 120dqrmn105 remaindernear 0.0E5 0 -> NaN Division_undefined 121dqrmn106 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] 125dqrmn107 remaindernear 0.0001 0 -> NaN Invalid_operation 126dqrmn108 remaindernear 0.01 0 -> NaN Invalid_operation 127dqrmn109 remaindernear 0.1 0 -> NaN Invalid_operation 128dqrmn110 remaindernear 1 0 -> NaN Invalid_operation 129dqrmn111 remaindernear 1 0.0 -> NaN Invalid_operation 130dqrmn112 remaindernear 10 0.0 -> NaN Invalid_operation 131dqrmn113 remaindernear 1E+100 0.0 -> NaN Invalid_operation 132dqrmn114 remaindernear 1E+380 0 -> NaN Invalid_operation 133dqrmn115 remaindernear 0.0001 -0 -> NaN Invalid_operation 134dqrmn116 remaindernear 0.01 -0 -> NaN Invalid_operation 135dqrmn119 remaindernear 0.1 -0 -> NaN Invalid_operation 136dqrmn120 remaindernear 1 -0 -> NaN Invalid_operation 137dqrmn121 remaindernear 1 -0.0 -> NaN Invalid_operation 138dqrmn122 remaindernear 10 -0.0 -> NaN Invalid_operation 139dqrmn123 remaindernear 1E+100 -0.0 -> NaN Invalid_operation 140dqrmn124 remaindernear 1E+384 -0 -> NaN Invalid_operation 141-- and zeros on left 142dqrmn130 remaindernear 0 1 -> 0 143dqrmn131 remaindernear 0 -1 -> 0 144dqrmn132 remaindernear 0.0 1 -> 0.0 145dqrmn133 remaindernear 0.0 -1 -> 0.0 146dqrmn134 remaindernear -0 1 -> -0 147dqrmn135 remaindernear -0 -1 -> -0 148dqrmn136 remaindernear -0.0 1 -> -0.0 149dqrmn137 remaindernear -0.0 -1 -> -0.0 150 151-- 0.5ers 152dqrmn143 remaindernear 0.5 2 -> 0.5 153dqrmn144 remaindernear 0.5 2.1 -> 0.5 154dqrmn145 remaindernear 0.5 2.01 -> 0.50 155dqrmn146 remaindernear 0.5 2.001 -> 0.500 156dqrmn147 remaindernear 0.50 2 -> 0.50 157dqrmn148 remaindernear 0.50 2.01 -> 0.50 158dqrmn149 remaindernear 0.50 2.001 -> 0.500 159 160-- steadies 161dqrmn150 remaindernear 1 1 -> 0 162dqrmn151 remaindernear 1 2 -> 1 163dqrmn152 remaindernear 1 3 -> 1 164dqrmn153 remaindernear 1 4 -> 1 165dqrmn154 remaindernear 1 5 -> 1 166dqrmn155 remaindernear 1 6 -> 1 167dqrmn156 remaindernear 1 7 -> 1 168dqrmn157 remaindernear 1 8 -> 1 169dqrmn158 remaindernear 1 9 -> 1 170dqrmn159 remaindernear 1 10 -> 1 171dqrmn160 remaindernear 1 1 -> 0 172dqrmn161 remaindernear 2 1 -> 0 173dqrmn162 remaindernear 3 1 -> 0 174dqrmn163 remaindernear 4 1 -> 0 175dqrmn164 remaindernear 5 1 -> 0 176dqrmn165 remaindernear 6 1 -> 0 177dqrmn166 remaindernear 7 1 -> 0 178dqrmn167 remaindernear 8 1 -> 0 179dqrmn168 remaindernear 9 1 -> 0 180dqrmn169 remaindernear 10 1 -> 0 181 182-- some differences from remainder 183dqrmn171 remaindernear 0.4 1.020 -> 0.400 184dqrmn172 remaindernear 0.50 1.020 -> 0.500 185dqrmn173 remaindernear 0.51 1.020 -> 0.510 186dqrmn174 remaindernear 0.52 1.020 -> -0.500 187dqrmn175 remaindernear 0.6 1.020 -> -0.420 188 189-- More flavours of remaindernear by 0 190dqrmn201 remaindernear 0 0 -> NaN Division_undefined 191dqrmn202 remaindernear 0.0E5 0 -> NaN Division_undefined 192dqrmn203 remaindernear 0.000 0 -> NaN Division_undefined 193dqrmn204 remaindernear 0.0001 0 -> NaN Invalid_operation 194dqrmn205 remaindernear 0.01 0 -> NaN Invalid_operation 195dqrmn206 remaindernear 0.1 0 -> NaN Invalid_operation 196dqrmn207 remaindernear 1 0 -> NaN Invalid_operation 197dqrmn208 remaindernear 1 0.0 -> NaN Invalid_operation 198dqrmn209 remaindernear 10 0.0 -> NaN Invalid_operation 199dqrmn210 remaindernear 1E+100 0.0 -> NaN Invalid_operation 200dqrmn211 remaindernear 1E+380 0 -> NaN Invalid_operation 201 202-- tests from the extended specification 203dqrmn221 remaindernear 2.1 3 -> -0.9 204dqrmn222 remaindernear 10 6 -> -2 205dqrmn223 remaindernear 10 3 -> 1 206dqrmn224 remaindernear -10 3 -> -1 207dqrmn225 remaindernear 10.2 1 -> 0.2 208dqrmn226 remaindernear 10 0.3 -> 0.1 209dqrmn227 remaindernear 3.6 1.3 -> -0.3 210 211-- some differences from remainder 212dqrmn231 remaindernear -0.4 1.020 -> -0.400 213dqrmn232 remaindernear -0.50 1.020 -> -0.500 214dqrmn233 remaindernear -0.51 1.020 -> -0.510 215dqrmn234 remaindernear -0.52 1.020 -> 0.500 216dqrmn235 remaindernear -0.6 1.020 -> 0.420 217 218-- high Xs 219dqrmn240 remaindernear 1E+2 1.00 -> 0.00 220 221-- dqrmn3xx are from DiagBigDecimal 222dqrmn301 remaindernear 1 3 -> 1 223dqrmn302 remaindernear 5 5 -> 0 224dqrmn303 remaindernear 13 10 -> 3 225dqrmn304 remaindernear 13 50 -> 13 226dqrmn305 remaindernear 13 100 -> 13 227dqrmn306 remaindernear 13 1000 -> 13 228dqrmn307 remaindernear .13 1 -> 0.13 229dqrmn308 remaindernear 0.133 1 -> 0.133 230dqrmn309 remaindernear 0.1033 1 -> 0.1033 231dqrmn310 remaindernear 1.033 1 -> 0.033 232dqrmn311 remaindernear 10.33 1 -> 0.33 233dqrmn312 remaindernear 10.33 10 -> 0.33 234dqrmn313 remaindernear 103.3 1 -> 0.3 235dqrmn314 remaindernear 133 10 -> 3 236dqrmn315 remaindernear 1033 10 -> 3 237dqrmn316 remaindernear 1033 50 -> -17 238dqrmn317 remaindernear 101.0 3 -> -1.0 239dqrmn318 remaindernear 102.0 3 -> 0.0 240dqrmn319 remaindernear 103.0 3 -> 1.0 241dqrmn320 remaindernear 2.40 1 -> 0.40 242dqrmn321 remaindernear 2.400 1 -> 0.400 243dqrmn322 remaindernear 2.4 1 -> 0.4 244dqrmn323 remaindernear 2.4 2 -> 0.4 245dqrmn324 remaindernear 2.400 2 -> 0.400 246dqrmn325 remaindernear 1 0.3 -> 0.1 247dqrmn326 remaindernear 1 0.30 -> 0.10 248dqrmn327 remaindernear 1 0.300 -> 0.100 249dqrmn328 remaindernear 1 0.3000 -> 0.1000 250dqrmn329 remaindernear 1.0 0.3 -> 0.1 251dqrmn330 remaindernear 1.00 0.3 -> 0.10 252dqrmn331 remaindernear 1.000 0.3 -> 0.100 253dqrmn332 remaindernear 1.0000 0.3 -> 0.1000 254dqrmn333 remaindernear 0.5 2 -> 0.5 255dqrmn334 remaindernear 0.5 2.1 -> 0.5 256dqrmn335 remaindernear 0.5 2.01 -> 0.50 257dqrmn336 remaindernear 0.5 2.001 -> 0.500 258dqrmn337 remaindernear 0.50 2 -> 0.50 259dqrmn338 remaindernear 0.50 2.01 -> 0.50 260dqrmn339 remaindernear 0.50 2.001 -> 0.500 261 262dqrmn340 remaindernear 0.5 0.5000001 -> -1E-7 263dqrmn341 remaindernear 0.5 0.50000001 -> -1E-8 264dqrmn342 remaindernear 0.5 0.500000001 -> -1E-9 265dqrmn343 remaindernear 0.5 0.5000000001 -> -1E-10 266dqrmn344 remaindernear 0.5 0.50000000001 -> -1E-11 267dqrmn345 remaindernear 0.5 0.4999999 -> 1E-7 268dqrmn346 remaindernear 0.5 0.49999999 -> 1E-8 269dqrmn347 remaindernear 0.5 0.499999999 -> 1E-9 270dqrmn348 remaindernear 0.5 0.4999999999 -> 1E-10 271dqrmn349 remaindernear 0.5 0.49999999999 -> 1E-11 272dqrmn350 remaindernear 0.5 0.499999999999 -> 1E-12 273 274dqrmn351 remaindernear 0.03 7 -> 0.03 275dqrmn352 remaindernear 5 2 -> 1 276dqrmn353 remaindernear 4.1 2 -> 0.1 277dqrmn354 remaindernear 4.01 2 -> 0.01 278dqrmn355 remaindernear 4.001 2 -> 0.001 279dqrmn356 remaindernear 4.0001 2 -> 0.0001 280dqrmn357 remaindernear 4.00001 2 -> 0.00001 281dqrmn358 remaindernear 4.000001 2 -> 0.000001 282dqrmn359 remaindernear 4.0000001 2 -> 1E-7 283 284dqrmn360 remaindernear 1.2 0.7345 -> -0.2690 285dqrmn361 remaindernear 0.8 12 -> 0.8 286dqrmn362 remaindernear 0.8 0.2 -> 0.0 287dqrmn363 remaindernear 0.8 0.3 -> -0.1 288dqrmn364 remaindernear 0.800 12 -> 0.800 289dqrmn365 remaindernear 0.800 1.7 -> 0.800 290dqrmn366 remaindernear 2.400 2 -> 0.400 291 292-- round to even 293dqrmn371 remaindernear 121 2 -> 1 294dqrmn372 remaindernear 122 2 -> 0 295dqrmn373 remaindernear 123 2 -> -1 296dqrmn374 remaindernear 124 2 -> 0 297dqrmn375 remaindernear 125 2 -> 1 298dqrmn376 remaindernear 126 2 -> 0 299dqrmn377 remaindernear 127 2 -> -1 300 301dqrmn381 remaindernear 12345 1 -> 0 302dqrmn382 remaindernear 12345 1.0001 -> -0.2344 303dqrmn383 remaindernear 12345 1.001 -> -0.333 304dqrmn384 remaindernear 12345 1.01 -> -0.23 305dqrmn385 remaindernear 12345 1.1 -> -0.3 306dqrmn386 remaindernear 12355 4 -> -1 307dqrmn387 remaindernear 12345 4 -> 1 308dqrmn388 remaindernear 12355 4.0001 -> -1.3089 309dqrmn389 remaindernear 12345 4.0001 -> 0.6914 310dqrmn390 remaindernear 12345 4.9 -> 1.9 311dqrmn391 remaindernear 12345 4.99 -> -0.26 312dqrmn392 remaindernear 12345 4.999 -> 2.469 313dqrmn393 remaindernear 12345 4.9999 -> 0.2469 314dqrmn394 remaindernear 12345 5 -> 0 315dqrmn395 remaindernear 12345 5.0001 -> -0.2469 316dqrmn396 remaindernear 12345 5.001 -> -2.469 317dqrmn397 remaindernear 12345 5.01 -> 0.36 318dqrmn398 remaindernear 12345 5.1 -> -2.1 319 320-- the nasty division-by-1 cases 321dqrmn401 remaindernear 0.4 1 -> 0.4 322dqrmn402 remaindernear 0.45 1 -> 0.45 323dqrmn403 remaindernear 0.455 1 -> 0.455 324dqrmn404 remaindernear 0.4555 1 -> 0.4555 325dqrmn405 remaindernear 0.45555 1 -> 0.45555 326dqrmn406 remaindernear 0.455555 1 -> 0.455555 327dqrmn407 remaindernear 0.4555555 1 -> 0.4555555 328dqrmn408 remaindernear 0.45555555 1 -> 0.45555555 329dqrmn409 remaindernear 0.455555555 1 -> 0.455555555 330-- with spill... [412 exercises sticktab loop] 331dqrmn411 remaindernear 0.5 1 -> 0.5 332dqrmn412 remaindernear 0.55 1 -> -0.45 333dqrmn413 remaindernear 0.555 1 -> -0.445 334dqrmn414 remaindernear 0.5555 1 -> -0.4445 335dqrmn415 remaindernear 0.55555 1 -> -0.44445 336dqrmn416 remaindernear 0.555555 1 -> -0.444445 337dqrmn417 remaindernear 0.5555555 1 -> -0.4444445 338dqrmn418 remaindernear 0.55555555 1 -> -0.44444445 339dqrmn419 remaindernear 0.555555555 1 -> -0.444444445 340 341-- folddowns 342dqrmn421 remaindernear 1E+6144 1 -> NaN Division_impossible 343dqrmn422 remaindernear 1E+6144 1E+6143 -> 0E+6111 Clamped 344dqrmn423 remaindernear 1E+6144 2E+6143 -> 0E+6111 Clamped 345dqrmn424 remaindernear 1E+6144 3E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped 346dqrmn425 remaindernear 1E+6144 4E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped 347dqrmn426 remaindernear 1E+6144 5E+6143 -> 0E+6111 Clamped 348dqrmn427 remaindernear 1E+6144 6E+6143 -> -2.00000000000000000000000000000000E+6143 Clamped 349dqrmn428 remaindernear 1E+6144 7E+6143 -> 3.00000000000000000000000000000000E+6143 Clamped 350dqrmn429 remaindernear 1E+6144 8E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped 351dqrmn430 remaindernear 1E+6144 9E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped 352-- tinies 353dqrmn431 remaindernear 1E-6175 1E-6176 -> 0E-6176 354dqrmn432 remaindernear 1E-6175 2E-6176 -> 0E-6176 355dqrmn433 remaindernear 1E-6175 3E-6176 -> 1E-6176 Subnormal 356dqrmn434 remaindernear 1E-6175 4E-6176 -> 2E-6176 Subnormal 357dqrmn435 remaindernear 1E-6175 5E-6176 -> 0E-6176 358dqrmn436 remaindernear 1E-6175 6E-6176 -> -2E-6176 Subnormal 359dqrmn437 remaindernear 1E-6175 7E-6176 -> 3E-6176 Subnormal 360dqrmn438 remaindernear 1E-6175 8E-6176 -> 2E-6176 Subnormal 361dqrmn439 remaindernear 1E-6175 9E-6176 -> 1E-6176 Subnormal 362dqrmn440 remaindernear 1E-6175 10E-6176 -> 0E-6176 363dqrmn441 remaindernear 1E-6175 11E-6176 -> -1E-6176 Subnormal 364dqrmn442 remaindernear 100E-6175 11E-6176 -> -1E-6176 Subnormal 365dqrmn443 remaindernear 100E-6175 20E-6176 -> 0E-6176 366dqrmn444 remaindernear 100E-6175 21E-6176 -> -8E-6176 Subnormal 367dqrmn445 remaindernear 100E-6175 30E-6176 -> 1.0E-6175 Subnormal 368 369-- zero signs 370dqrmn650 remaindernear 1 1 -> 0 371dqrmn651 remaindernear -1 1 -> -0 372dqrmn652 remaindernear 1 -1 -> 0 373dqrmn653 remaindernear -1 -1 -> -0 374dqrmn654 remaindernear 0 1 -> 0 375dqrmn655 remaindernear -0 1 -> -0 376dqrmn656 remaindernear 0 -1 -> 0 377dqrmn657 remaindernear -0 -1 -> -0 378dqrmn658 remaindernear 0.00 1 -> 0.00 379dqrmn659 remaindernear -0.00 1 -> -0.00 380 381-- Specials 382dqrmn680 remaindernear Inf -Inf -> NaN Invalid_operation 383dqrmn681 remaindernear Inf -1000 -> NaN Invalid_operation 384dqrmn682 remaindernear Inf -1 -> NaN Invalid_operation 385dqrmn683 remaindernear Inf 0 -> NaN Invalid_operation 386dqrmn684 remaindernear Inf -0 -> NaN Invalid_operation 387dqrmn685 remaindernear Inf 1 -> NaN Invalid_operation 388dqrmn686 remaindernear Inf 1000 -> NaN Invalid_operation 389dqrmn687 remaindernear Inf Inf -> NaN Invalid_operation 390dqrmn688 remaindernear -1000 Inf -> -1000 391dqrmn689 remaindernear -Inf Inf -> NaN Invalid_operation 392dqrmn691 remaindernear -1 Inf -> -1 393dqrmn692 remaindernear 0 Inf -> 0 394dqrmn693 remaindernear -0 Inf -> -0 395dqrmn694 remaindernear 1 Inf -> 1 396dqrmn695 remaindernear 1000 Inf -> 1000 397dqrmn696 remaindernear Inf Inf -> NaN Invalid_operation 398 399dqrmn700 remaindernear -Inf -Inf -> NaN Invalid_operation 400dqrmn701 remaindernear -Inf -1000 -> NaN Invalid_operation 401dqrmn702 remaindernear -Inf -1 -> NaN Invalid_operation 402dqrmn703 remaindernear -Inf -0 -> NaN Invalid_operation 403dqrmn704 remaindernear -Inf 0 -> NaN Invalid_operation 404dqrmn705 remaindernear -Inf 1 -> NaN Invalid_operation 405dqrmn706 remaindernear -Inf 1000 -> NaN Invalid_operation 406dqrmn707 remaindernear -Inf Inf -> NaN Invalid_operation 407dqrmn708 remaindernear -Inf -Inf -> NaN Invalid_operation 408dqrmn709 remaindernear -1000 Inf -> -1000 409dqrmn710 remaindernear -1 -Inf -> -1 410dqrmn711 remaindernear -0 -Inf -> -0 411dqrmn712 remaindernear 0 -Inf -> 0 412dqrmn713 remaindernear 1 -Inf -> 1 413dqrmn714 remaindernear 1000 -Inf -> 1000 414dqrmn715 remaindernear Inf -Inf -> NaN Invalid_operation 415 416dqrmn721 remaindernear NaN -Inf -> NaN 417dqrmn722 remaindernear NaN -1000 -> NaN 418dqrmn723 remaindernear NaN -1 -> NaN 419dqrmn724 remaindernear NaN -0 -> NaN 420dqrmn725 remaindernear -NaN 0 -> -NaN 421dqrmn726 remaindernear NaN 1 -> NaN 422dqrmn727 remaindernear NaN 1000 -> NaN 423dqrmn728 remaindernear NaN Inf -> NaN 424dqrmn729 remaindernear NaN -NaN -> NaN 425dqrmn730 remaindernear -Inf NaN -> NaN 426dqrmn731 remaindernear -1000 NaN -> NaN 427dqrmn732 remaindernear -1 NaN -> NaN 428dqrmn733 remaindernear -0 -NaN -> -NaN 429dqrmn734 remaindernear 0 NaN -> NaN 430dqrmn735 remaindernear 1 -NaN -> -NaN 431dqrmn736 remaindernear 1000 NaN -> NaN 432dqrmn737 remaindernear Inf NaN -> NaN 433 434dqrmn741 remaindernear sNaN -Inf -> NaN Invalid_operation 435dqrmn742 remaindernear sNaN -1000 -> NaN Invalid_operation 436dqrmn743 remaindernear -sNaN -1 -> -NaN Invalid_operation 437dqrmn744 remaindernear sNaN -0 -> NaN Invalid_operation 438dqrmn745 remaindernear sNaN 0 -> NaN Invalid_operation 439dqrmn746 remaindernear sNaN 1 -> NaN Invalid_operation 440dqrmn747 remaindernear sNaN 1000 -> NaN Invalid_operation 441dqrmn749 remaindernear sNaN NaN -> NaN Invalid_operation 442dqrmn750 remaindernear sNaN sNaN -> NaN Invalid_operation 443dqrmn751 remaindernear NaN sNaN -> NaN Invalid_operation 444dqrmn752 remaindernear -Inf sNaN -> NaN Invalid_operation 445dqrmn753 remaindernear -1000 sNaN -> NaN Invalid_operation 446dqrmn754 remaindernear -1 sNaN -> NaN Invalid_operation 447dqrmn755 remaindernear -0 sNaN -> NaN Invalid_operation 448dqrmn756 remaindernear 0 sNaN -> NaN Invalid_operation 449dqrmn757 remaindernear 1 sNaN -> NaN Invalid_operation 450dqrmn758 remaindernear 1000 sNaN -> NaN Invalid_operation 451dqrmn759 remaindernear Inf -sNaN -> -NaN Invalid_operation 452 453-- propaging NaNs 454dqrmn760 remaindernear NaN1 NaN7 -> NaN1 455dqrmn761 remaindernear sNaN2 NaN8 -> NaN2 Invalid_operation 456dqrmn762 remaindernear NaN3 sNaN9 -> NaN9 Invalid_operation 457dqrmn763 remaindernear sNaN4 sNaN10 -> NaN4 Invalid_operation 458dqrmn764 remaindernear 15 NaN11 -> NaN11 459dqrmn765 remaindernear NaN6 NaN12 -> NaN6 460dqrmn766 remaindernear Inf NaN13 -> NaN13 461dqrmn767 remaindernear NaN14 -Inf -> NaN14 462dqrmn768 remaindernear 0 NaN15 -> NaN15 463dqrmn769 remaindernear NaN16 -0 -> NaN16 464 465-- edge cases of impossible 466dqrmn770 remaindernear 1234500000000000000000067890123456 10 -> -4 467dqrmn771 remaindernear 1234500000000000000000067890123456 1 -> 0 468dqrmn772 remaindernear 1234500000000000000000067890123456 0.1 -> NaN Division_impossible 469dqrmn773 remaindernear 1234500000000000000000067890123456 0.01 -> NaN Division_impossible 470 471-- long operand checks 472dqrmn801 remaindernear 12345678000 100 -> 0 473dqrmn802 remaindernear 1 12345678000 -> 1 474dqrmn803 remaindernear 1234567800 10 -> 0 475dqrmn804 remaindernear 1 1234567800 -> 1 476dqrmn805 remaindernear 1234567890 10 -> 0 477dqrmn806 remaindernear 1 1234567890 -> 1 478dqrmn807 remaindernear 1234567891 10 -> 1 479dqrmn808 remaindernear 1 1234567891 -> 1 480dqrmn809 remaindernear 12345678901 100 -> 1 481dqrmn810 remaindernear 1 12345678901 -> 1 482dqrmn811 remaindernear 1234567896 10 -> -4 483dqrmn812 remaindernear 1 1234567896 -> 1 484 485dqrmn821 remaindernear 12345678000 100 -> 0 486dqrmn822 remaindernear 1 12345678000 -> 1 487dqrmn823 remaindernear 1234567800 10 -> 0 488dqrmn824 remaindernear 1 1234567800 -> 1 489dqrmn825 remaindernear 1234567890 10 -> 0 490dqrmn826 remaindernear 1 1234567890 -> 1 491dqrmn827 remaindernear 1234567891 10 -> 1 492dqrmn828 remaindernear 1 1234567891 -> 1 493dqrmn829 remaindernear 12345678901 100 -> 1 494dqrmn830 remaindernear 1 12345678901 -> 1 495dqrmn831 remaindernear 1234567896 10 -> -4 496dqrmn832 remaindernear 1 1234567896 -> 1 497 498-- from divideint 499dqrmn840 remaindernear 100000000.0 1 -> 0.0 500dqrmn841 remaindernear 100000000.4 1 -> 0.4 501dqrmn842 remaindernear 100000000.5 1 -> 0.5 502dqrmn843 remaindernear 100000000.9 1 -> -0.1 503dqrmn844 remaindernear 100000000.999 1 -> -0.001 504dqrmn850 remaindernear 100000003 5 -> -2 505dqrmn851 remaindernear 10000003 5 -> -2 506dqrmn852 remaindernear 1000003 5 -> -2 507dqrmn853 remaindernear 100003 5 -> -2 508dqrmn854 remaindernear 10003 5 -> -2 509dqrmn855 remaindernear 1003 5 -> -2 510dqrmn856 remaindernear 103 5 -> -2 511dqrmn857 remaindernear 13 5 -> -2 512dqrmn858 remaindernear 1 5 -> 1 513 514-- Vladimir's cases 1234567890123456 515dqrmn860 remaindernear 123.0e1 1000000000000000 -> 1230 516dqrmn861 remaindernear 1230 1000000000000000 -> 1230 517dqrmn862 remaindernear 12.3e2 1000000000000000 -> 1230 518dqrmn863 remaindernear 1.23e3 1000000000000000 -> 1230 519dqrmn864 remaindernear 123e1 1000000000000000 -> 1230 520dqrmn870 remaindernear 123e1 1000000000000000 -> 1230 521dqrmn871 remaindernear 123e1 100000000000000 -> 1230 522dqrmn872 remaindernear 123e1 10000000000000 -> 1230 523dqrmn873 remaindernear 123e1 1000000000000 -> 1230 524dqrmn874 remaindernear 123e1 100000000000 -> 1230 525dqrmn875 remaindernear 123e1 10000000000 -> 1230 526dqrmn876 remaindernear 123e1 1000000000 -> 1230 527dqrmn877 remaindernear 123e1 100000000 -> 1230 528dqrmn878 remaindernear 1230 100000000 -> 1230 529dqrmn879 remaindernear 123e1 10000000 -> 1230 530dqrmn880 remaindernear 123e1 1000000 -> 1230 531dqrmn881 remaindernear 123e1 100000 -> 1230 532dqrmn882 remaindernear 123e1 10000 -> 1230 533dqrmn883 remaindernear 123e1 1000 -> 230 534dqrmn884 remaindernear 123e1 100 -> 30 535dqrmn885 remaindernear 123e1 10 -> 0 536dqrmn886 remaindernear 123e1 1 -> 0 537 538dqrmn890 remaindernear 123e1 2000000000000000 -> 1230 539dqrmn891 remaindernear 123e1 200000000000000 -> 1230 540dqrmn892 remaindernear 123e1 20000000000000 -> 1230 541dqrmn893 remaindernear 123e1 2000000000000 -> 1230 542dqrmn894 remaindernear 123e1 200000000000 -> 1230 543dqrmn895 remaindernear 123e1 20000000000 -> 1230 544dqrmn896 remaindernear 123e1 2000000000 -> 1230 545dqrmn897 remaindernear 123e1 200000000 -> 1230 546dqrmn899 remaindernear 123e1 20000000 -> 1230 547dqrmn900 remaindernear 123e1 2000000 -> 1230 548dqrmn901 remaindernear 123e1 200000 -> 1230 549dqrmn902 remaindernear 123e1 20000 -> 1230 550dqrmn903 remaindernear 123e1 2000 -> -770 551dqrmn904 remaindernear 123e1 200 -> 30 552dqrmn905 remaindernear 123e1 20 -> -10 553dqrmn906 remaindernear 123e1 2 -> 0 554 555dqrmn910 remaindernear 123e1 5000000000000000 -> 1230 556dqrmn911 remaindernear 123e1 500000000000000 -> 1230 557dqrmn912 remaindernear 123e1 50000000000000 -> 1230 558dqrmn913 remaindernear 123e1 5000000000000 -> 1230 559dqrmn914 remaindernear 123e1 500000000000 -> 1230 560dqrmn915 remaindernear 123e1 50000000000 -> 1230 561dqrmn916 remaindernear 123e1 5000000000 -> 1230 562dqrmn917 remaindernear 123e1 500000000 -> 1230 563dqrmn919 remaindernear 123e1 50000000 -> 1230 564dqrmn920 remaindernear 123e1 5000000 -> 1230 565dqrmn921 remaindernear 123e1 500000 -> 1230 566dqrmn922 remaindernear 123e1 50000 -> 1230 567dqrmn923 remaindernear 123e1 5000 -> 1230 568dqrmn924 remaindernear 123e1 500 -> 230 569dqrmn925 remaindernear 123e1 50 -> -20 570dqrmn926 remaindernear 123e1 5 -> 0 571 572dqrmn930 remaindernear 123e1 9000000000000000 -> 1230 573dqrmn931 remaindernear 123e1 900000000000000 -> 1230 574dqrmn932 remaindernear 123e1 90000000000000 -> 1230 575dqrmn933 remaindernear 123e1 9000000000000 -> 1230 576dqrmn934 remaindernear 123e1 900000000000 -> 1230 577dqrmn935 remaindernear 123e1 90000000000 -> 1230 578dqrmn936 remaindernear 123e1 9000000000 -> 1230 579dqrmn937 remaindernear 123e1 900000000 -> 1230 580dqrmn939 remaindernear 123e1 90000000 -> 1230 581dqrmn940 remaindernear 123e1 9000000 -> 1230 582dqrmn941 remaindernear 123e1 900000 -> 1230 583dqrmn942 remaindernear 123e1 90000 -> 1230 584dqrmn943 remaindernear 123e1 9000 -> 1230 585dqrmn944 remaindernear 123e1 900 -> 330 586dqrmn945 remaindernear 123e1 90 -> -30 587dqrmn946 remaindernear 123e1 9 -> -3 588 589dqrmn950 remaindernear 123e1 1000000000000000 -> 1230 590dqrmn961 remaindernear 123e1 2999999999999999 -> 1230 591dqrmn962 remaindernear 123e1 3999999999999999 -> 1230 592dqrmn963 remaindernear 123e1 4999999999999999 -> 1230 593dqrmn964 remaindernear 123e1 5999999999999999 -> 1230 594dqrmn965 remaindernear 123e1 6999999999999999 -> 1230 595dqrmn966 remaindernear 123e1 7999999999999999 -> 1230 596dqrmn967 remaindernear 123e1 8999999999999999 -> 1230 597dqrmn968 remaindernear 123e1 9999999999999999 -> 1230 598dqrmn969 remaindernear 123e1 9876543210987654 -> 1230 599 600dqrmn980 remaindernear 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally 601 602-- overflow and underflow tests [from divide] 603dqrmn1051 remaindernear 1e+277 1e-311 -> NaN Division_impossible 604dqrmn1052 remaindernear 1e+277 -1e-311 -> NaN Division_impossible 605dqrmn1053 remaindernear -1e+277 1e-311 -> NaN Division_impossible 606dqrmn1054 remaindernear -1e+277 -1e-311 -> NaN Division_impossible 607dqrmn1055 remaindernear 1e-277 1e+311 -> 1E-277 608dqrmn1056 remaindernear 1e-277 -1e+311 -> 1E-277 609dqrmn1057 remaindernear -1e-277 1e+311 -> -1E-277 610dqrmn1058 remaindernear -1e-277 -1e+311 -> -1E-277 611 612-- Gyuris example 613dqrmn1070 remainder 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 8.336804418094040989630006819881709E-6143 614 615-- destructive subtract 616dqrmn1101 remaindernear 1234567890123456789012345678901234 1.000000000000000000000000000000001 -> -0.234567890123456789012345678901233 617dqrmn1102 remaindernear 1234567890123456789012345678901234 1.00000000000000000000000000000001 -> -0.34567890123456789012345678901222 618dqrmn1103 remaindernear 1234567890123456789012345678901234 1.0000000000000000000000000000001 -> -0.4567890123456789012345678901111 619dqrmn1104 remaindernear 1234567890123456789012345678901255 4.000000000000000000000000000000001 -> -1.308641972530864197253086419725314 620dqrmn1105 remaindernear 1234567890123456789012345678901234 4.000000000000000000000000000000001 -> 1.691358027469135802746913580274692 621dqrmn1106 remaindernear 1234567890123456789012345678901234 4.9999999999999999999999999999999 -> -1.3086421975308642197530864219748 622dqrmn1107 remaindernear 1234567890123456789012345678901234 4.99999999999999999999999999999999 -> 1.46913578024691357802469135780247 623dqrmn1108 remaindernear 1234567890123456789012345678901234 4.999999999999999999999999999999999 -> -0.753086421975308642197530864219753 624dqrmn1109 remaindernear 1234567890123456789012345678901234 5.000000000000000000000000000000001 -> -1.246913578024691357802469135780247 625dqrmn1110 remaindernear 1234567890123456789012345678901234 5.00000000000000000000000000000001 -> 1.53086421975308642197530864219754 626dqrmn1111 remaindernear 1234567890123456789012345678901234 5.0000000000000000000000000000001 -> -0.6913578024691357802469135780242 627 628-- Null tests 629dqrmn1000 remaindernear 10 # -> NaN Invalid_operation 630dqrmn1001 remaindernear # 10 -> NaN Invalid_operation 631 632