1 ------------------------------------------------------------------------ 2 -- remainderNear.decTest -- decimal remainder-near (IEEE remainder) -- 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 extended: 1 23 precision: 9 24 rounding: half_up 25 maxExponent: 384 26 minexponent: -383 27 28 rmnx001 remaindernear 1 1 -> 0 29 rmnx002 remaindernear 2 1 -> 0 30 rmnx003 remaindernear 1 2 -> 1 31 rmnx004 remaindernear 2 2 -> 0 32 rmnx005 remaindernear 0 1 -> 0 33 rmnx006 remaindernear 0 2 -> 0 34 rmnx007 remaindernear 1 3 -> 1 35 rmnx008 remaindernear 2 3 -> -1 36 rmnx009 remaindernear 3 3 -> 0 37 38 rmnx010 remaindernear 2.4 1 -> 0.4 39 rmnx011 remaindernear 2.4 -1 -> 0.4 40 rmnx012 remaindernear -2.4 1 -> -0.4 41 rmnx013 remaindernear -2.4 -1 -> -0.4 42 rmnx014 remaindernear 2.40 1 -> 0.40 43 rmnx015 remaindernear 2.400 1 -> 0.400 44 rmnx016 remaindernear 2.4 2 -> 0.4 45 rmnx017 remaindernear 2.400 2 -> 0.400 46 rmnx018 remaindernear 2. 2 -> 0 47 rmnx019 remaindernear 20 20 -> 0 48 49 rmnx020 remaindernear 187 187 -> 0 50 rmnx021 remaindernear 5 2 -> 1 51 rmnx022 remaindernear 5 2.0 -> 1.0 52 rmnx023 remaindernear 5 2.000 -> 1.000 53 rmnx024 remaindernear 5 0.200 -> 0.000 54 rmnx025 remaindernear 5 0.200 -> 0.000 55 56 rmnx030 remaindernear 1 2 -> 1 57 rmnx031 remaindernear 1 4 -> 1 58 rmnx032 remaindernear 1 8 -> 1 59 rmnx033 remaindernear 1 16 -> 1 60 rmnx034 remaindernear 1 32 -> 1 61 rmnx035 remaindernear 1 64 -> 1 62 rmnx040 remaindernear 1 -2 -> 1 63 rmnx041 remaindernear 1 -4 -> 1 64 rmnx042 remaindernear 1 -8 -> 1 65 rmnx043 remaindernear 1 -16 -> 1 66 rmnx044 remaindernear 1 -32 -> 1 67 rmnx045 remaindernear 1 -64 -> 1 68 rmnx050 remaindernear -1 2 -> -1 69 rmnx051 remaindernear -1 4 -> -1 70 rmnx052 remaindernear -1 8 -> -1 71 rmnx053 remaindernear -1 16 -> -1 72 rmnx054 remaindernear -1 32 -> -1 73 rmnx055 remaindernear -1 64 -> -1 74 rmnx060 remaindernear -1 -2 -> -1 75 rmnx061 remaindernear -1 -4 -> -1 76 rmnx062 remaindernear -1 -8 -> -1 77 rmnx063 remaindernear -1 -16 -> -1 78 rmnx064 remaindernear -1 -32 -> -1 79 rmnx065 remaindernear -1 -64 -> -1 80 81 rmnx066 remaindernear 999999997 1 -> 0 82 rmnx067 remaindernear 999999997.4 1 -> 0.4 83 rmnx068 remaindernear 999999997.5 1 -> -0.5 84 rmnx069 remaindernear 999999997.9 1 -> -0.1 85 rmnx070 remaindernear 999999997.999 1 -> -0.001 86 87 rmnx071 remaindernear 999999998 1 -> 0 88 rmnx072 remaindernear 999999998.4 1 -> 0.4 89 rmnx073 remaindernear 999999998.5 1 -> 0.5 90 rmnx074 remaindernear 999999998.9 1 -> -0.1 91 rmnx075 remaindernear 999999998.999 1 -> -0.001 92 93 rmnx076 remaindernear 999999999 1 -> 0 94 rmnx077 remaindernear 999999999.4 1 -> 0.4 95 rmnx078 remaindernear 999999999.5 1 -> NaN Division_impossible 96 rmnx079 remaindernear 999999999.9 1 -> NaN Division_impossible 97 rmnx080 remaindernear 999999999.999 1 -> NaN Division_impossible 98 99 precision: 6 100 rmnx081 remaindernear 999999999 1 -> NaN Division_impossible 101 rmnx082 remaindernear 99999999 1 -> NaN Division_impossible 102 rmnx083 remaindernear 9999999 1 -> NaN Division_impossible 103 rmnx084 remaindernear 999999 1 -> 0 104 rmnx085 remaindernear 99999 1 -> 0 105 rmnx086 remaindernear 9999 1 -> 0 106 rmnx087 remaindernear 999 1 -> 0 107 rmnx088 remaindernear 99 1 -> 0 108 rmnx089 remaindernear 9 1 -> 0 109 110 precision: 9 111 rmnx090 remaindernear 0. 1 -> 0 112 rmnx091 remaindernear .0 1 -> 0.0 113 rmnx092 remaindernear 0.00 1 -> 0.00 114 rmnx093 remaindernear 0.00E+9 1 -> 0 115 rmnx094 remaindernear 0.0000E-50 1 -> 0E-54 116 117 118 -- Various flavours of remaindernear by 0 119 precision: 9 120 maxexponent: 999999999 121 minexponent: -999999999 122 rmnx101 remaindernear 0 0 -> NaN Division_undefined 123 rmnx102 remaindernear 0 -0 -> NaN Division_undefined 124 rmnx103 remaindernear -0 0 -> NaN Division_undefined 125 rmnx104 remaindernear -0 -0 -> NaN Division_undefined 126 rmnx105 remaindernear 0.0E5 0 -> NaN Division_undefined 127 rmnx106 remaindernear 0.000 0 -> NaN Division_undefined 128 -- [Some think this next group should be Division_by_zero exception, 129 -- but IEEE 854 is explicit that it is Invalid operation .. for 130 -- remaindernear-near, anyway] 131 rmnx107 remaindernear 0.0001 0 -> NaN Invalid_operation 132 rmnx108 remaindernear 0.01 0 -> NaN Invalid_operation 133 rmnx109 remaindernear 0.1 0 -> NaN Invalid_operation 134 rmnx110 remaindernear 1 0 -> NaN Invalid_operation 135 rmnx111 remaindernear 1 0.0 -> NaN Invalid_operation 136 rmnx112 remaindernear 10 0.0 -> NaN Invalid_operation 137 rmnx113 remaindernear 1E+100 0.0 -> NaN Invalid_operation 138 rmnx114 remaindernear 1E+1000 0 -> NaN Invalid_operation 139 rmnx115 remaindernear 0.0001 -0 -> NaN Invalid_operation 140 rmnx116 remaindernear 0.01 -0 -> NaN Invalid_operation 141 rmnx119 remaindernear 0.1 -0 -> NaN Invalid_operation 142 rmnx120 remaindernear 1 -0 -> NaN Invalid_operation 143 rmnx121 remaindernear 1 -0.0 -> NaN Invalid_operation 144 rmnx122 remaindernear 10 -0.0 -> NaN Invalid_operation 145 rmnx123 remaindernear 1E+100 -0.0 -> NaN Invalid_operation 146 rmnx124 remaindernear 1E+1000 -0 -> NaN Invalid_operation 147 -- and zeros on left 148 rmnx130 remaindernear 0 1 -> 0 149 rmnx131 remaindernear 0 -1 -> 0 150 rmnx132 remaindernear 0.0 1 -> 0.0 151 rmnx133 remaindernear 0.0 -1 -> 0.0 152 rmnx134 remaindernear -0 1 -> -0 153 rmnx135 remaindernear -0 -1 -> -0 154 rmnx136 remaindernear -0.0 1 -> -0.0 155 rmnx137 remaindernear -0.0 -1 -> -0.0 156 157 -- 0.5ers 158 rmmx143 remaindernear 0.5 2 -> 0.5 159 rmmx144 remaindernear 0.5 2.1 -> 0.5 160 rmmx145 remaindernear 0.5 2.01 -> 0.50 161 rmmx146 remaindernear 0.5 2.001 -> 0.500 162 rmmx147 remaindernear 0.50 2 -> 0.50 163 rmmx148 remaindernear 0.50 2.01 -> 0.50 164 rmmx149 remaindernear 0.50 2.001 -> 0.500 165 166 -- some differences from remainder 167 rmnx150 remaindernear 0.4 1.020 -> 0.400 168 rmnx151 remaindernear 0.50 1.020 -> 0.500 169 rmnx152 remaindernear 0.51 1.020 -> 0.510 170 rmnx153 remaindernear 0.52 1.020 -> -0.500 171 rmnx154 remaindernear 0.6 1.020 -> -0.420 172 rmnx155 remaindernear 0.49 1 -> 0.49 173 rmnx156 remaindernear 0.50 1 -> 0.50 174 rmnx157 remaindernear 1.50 1 -> -0.50 175 rmnx158 remaindernear 2.50 1 -> 0.50 176 rmnx159 remaindernear 9.50 1 -> -0.50 177 rmnx160 remaindernear 0.51 1 -> -0.49 178 179 -- the nasty division-by-1 cases 180 rmnx161 remaindernear 0.4 1 -> 0.4 181 rmnx162 remaindernear 0.45 1 -> 0.45 182 rmnx163 remaindernear 0.455 1 -> 0.455 183 rmnx164 remaindernear 0.4555 1 -> 0.4555 184 rmnx165 remaindernear 0.45555 1 -> 0.45555 185 rmnx166 remaindernear 0.455555 1 -> 0.455555 186 rmnx167 remaindernear 0.4555555 1 -> 0.4555555 187 rmnx168 remaindernear 0.45555555 1 -> 0.45555555 188 rmnx169 remaindernear 0.455555555 1 -> 0.455555555 189 -- with spill... 190 rmnx171 remaindernear 0.5 1 -> 0.5 191 rmnx172 remaindernear 0.55 1 -> -0.45 192 rmnx173 remaindernear 0.555 1 -> -0.445 193 rmnx174 remaindernear 0.5555 1 -> -0.4445 194 rmnx175 remaindernear 0.55555 1 -> -0.44445 195 rmnx176 remaindernear 0.555555 1 -> -0.444445 196 rmnx177 remaindernear 0.5555555 1 -> -0.4444445 197 rmnx178 remaindernear 0.55555555 1 -> -0.44444445 198 rmnx179 remaindernear 0.555555555 1 -> -0.444444445 199 200 -- progression 201 rmnx180 remaindernear 1 1 -> 0 202 rmnx181 remaindernear 1 2 -> 1 203 rmnx182 remaindernear 1 3 -> 1 204 rmnx183 remaindernear 1 4 -> 1 205 rmnx184 remaindernear 1 5 -> 1 206 rmnx185 remaindernear 1 6 -> 1 207 rmnx186 remaindernear 1 7 -> 1 208 rmnx187 remaindernear 1 8 -> 1 209 rmnx188 remaindernear 1 9 -> 1 210 rmnx189 remaindernear 1 10 -> 1 211 rmnx190 remaindernear 1 1 -> 0 212 rmnx191 remaindernear 2 1 -> 0 213 rmnx192 remaindernear 3 1 -> 0 214 rmnx193 remaindernear 4 1 -> 0 215 rmnx194 remaindernear 5 1 -> 0 216 rmnx195 remaindernear 6 1 -> 0 217 rmnx196 remaindernear 7 1 -> 0 218 rmnx197 remaindernear 8 1 -> 0 219 rmnx198 remaindernear 9 1 -> 0 220 rmnx199 remaindernear 10 1 -> 0 221 222 223 -- Various flavours of remaindernear by 0 224 maxexponent: 999999999 225 minexponent: -999999999 226 rmnx201 remaindernear 0 0 -> NaN Division_undefined 227 rmnx202 remaindernear 0.0E5 0 -> NaN Division_undefined 228 rmnx203 remaindernear 0.000 0 -> NaN Division_undefined 229 rmnx204 remaindernear 0.0001 0 -> NaN Invalid_operation 230 rmnx205 remaindernear 0.01 0 -> NaN Invalid_operation 231 rmnx206 remaindernear 0.1 0 -> NaN Invalid_operation 232 rmnx207 remaindernear 1 0 -> NaN Invalid_operation 233 rmnx208 remaindernear 1 0.0 -> NaN Invalid_operation 234 rmnx209 remaindernear 10 0.0 -> NaN Invalid_operation 235 rmnx210 remaindernear 1E+100 0.0 -> NaN Invalid_operation 236 rmnx211 remaindernear 1E+1000 0 -> NaN Invalid_operation 237 238 -- tests from the extended specification 239 rmnx221 remaindernear 2.1 3 -> -0.9 240 rmnx222 remaindernear 10 6 -> -2 241 rmnx223 remaindernear 10 3 -> 1 242 rmnx224 remaindernear -10 3 -> -1 243 rmnx225 remaindernear 10.2 1 -> 0.2 244 rmnx226 remaindernear 10 0.3 -> 0.1 245 rmnx227 remaindernear 3.6 1.3 -> -0.3 246 247 -- some differences from remainder 248 rmnx231 remaindernear 0.4 1.020 -> 0.400 249 rmnx232 remaindernear 0.50 1.020 -> 0.500 250 rmnx233 remaindernear 0.51 1.020 -> 0.510 251 rmnx234 remaindernear 0.52 1.020 -> -0.500 252 rmnx235 remaindernear 0.6 1.020 -> -0.420 253 254 -- test some cases that are close to exponent overflow 255 maxexponent: 999999999 256 minexponent: -999999999 257 rmnx270 remaindernear 1 1e999999999 -> 1 258 rmnx271 remaindernear 1 0.9e999999999 -> 1 259 rmnx272 remaindernear 1 0.99e999999999 -> 1 260 rmnx273 remaindernear 1 0.999999999e999999999 -> 1 261 rmnx274 remaindernear 9e999999999 1 -> NaN Division_impossible 262 rmnx275 remaindernear 9.9e999999999 1 -> NaN Division_impossible 263 rmnx276 remaindernear 9.99e999999999 1 -> NaN Division_impossible 264 rmnx277 remaindernear 9.99999999e999999999 1 -> NaN Division_impossible 265 266 rmnx280 remaindernear 0.1 9e-999999999 -> NaN Division_impossible 267 rmnx281 remaindernear 0.1 99e-999999999 -> NaN Division_impossible 268 rmnx282 remaindernear 0.1 999e-999999999 -> NaN Division_impossible 269 270 rmnx283 remaindernear 0.1 9e-999999998 -> NaN Division_impossible 271 rmnx284 remaindernear 0.1 99e-999999998 -> NaN Division_impossible 272 rmnx285 remaindernear 0.1 999e-999999998 -> NaN Division_impossible 273 rmnx286 remaindernear 0.1 999e-999999997 -> NaN Division_impossible 274 rmnx287 remaindernear 0.1 9999e-999999997 -> NaN Division_impossible 275 rmnx288 remaindernear 0.1 99999e-999999997 -> NaN Division_impossible 276 277 -- rmnx3xx are from DiagBigDecimal 278 rmnx301 remaindernear 1 3 -> 1 279 rmnx302 remaindernear 5 5 -> 0 280 rmnx303 remaindernear 13 10 -> 3 281 rmnx304 remaindernear 13 50 -> 13 282 rmnx305 remaindernear 13 100 -> 13 283 rmnx306 remaindernear 13 1000 -> 13 284 rmnx307 remaindernear .13 1 -> 0.13 285 rmnx308 remaindernear 0.133 1 -> 0.133 286 rmnx309 remaindernear 0.1033 1 -> 0.1033 287 rmnx310 remaindernear 1.033 1 -> 0.033 288 rmnx311 remaindernear 10.33 1 -> 0.33 289 rmnx312 remaindernear 10.33 10 -> 0.33 290 rmnx313 remaindernear 103.3 1 -> 0.3 291 rmnx314 remaindernear 133 10 -> 3 292 rmnx315 remaindernear 1033 10 -> 3 293 rmnx316 remaindernear 1033 50 -> -17 294 rmnx317 remaindernear 101.0 3 -> -1.0 295 rmnx318 remaindernear 102.0 3 -> 0.0 296 rmnx319 remaindernear 103.0 3 -> 1.0 297 rmnx320 remaindernear 2.40 1 -> 0.40 298 rmnx321 remaindernear 2.400 1 -> 0.400 299 rmnx322 remaindernear 2.4 1 -> 0.4 300 rmnx323 remaindernear 2.4 2 -> 0.4 301 rmnx324 remaindernear 2.400 2 -> 0.400 302 rmnx325 remaindernear 1 0.3 -> 0.1 303 rmnx326 remaindernear 1 0.30 -> 0.10 304 rmnx327 remaindernear 1 0.300 -> 0.100 305 rmnx328 remaindernear 1 0.3000 -> 0.1000 306 rmnx329 remaindernear 1.0 0.3 -> 0.1 307 rmnx330 remaindernear 1.00 0.3 -> 0.10 308 rmnx331 remaindernear 1.000 0.3 -> 0.100 309 rmnx332 remaindernear 1.0000 0.3 -> 0.1000 310 rmnx333 remaindernear 0.5 2 -> 0.5 311 rmnx334 remaindernear 0.5 2.1 -> 0.5 312 rmnx335 remaindernear 0.5 2.01 -> 0.50 313 rmnx336 remaindernear 0.5 2.001 -> 0.500 314 rmnx337 remaindernear 0.50 2 -> 0.50 315 rmnx338 remaindernear 0.50 2.01 -> 0.50 316 rmnx339 remaindernear 0.50 2.001 -> 0.500 317 318 rmnx340 remaindernear 0.5 0.5000001 -> -1E-7 319 rmnx341 remaindernear 0.5 0.50000001 -> -1E-8 320 rmnx342 remaindernear 0.5 0.500000001 -> -1E-9 321 rmnx343 remaindernear 0.5 0.5000000001 -> -1E-10 322 rmnx344 remaindernear 0.5 0.50000000001 -> -1E-11 323 rmnx345 remaindernear 0.5 0.4999999 -> 1E-7 324 rmnx346 remaindernear 0.5 0.49999999 -> 1E-8 325 rmnx347 remaindernear 0.5 0.499999999 -> 1E-9 326 rmnx348 remaindernear 0.5 0.4999999999 -> 1E-10 327 rmnx349 remaindernear 0.5 0.49999999999 -> 1E-11 328 329 rmnx350 remaindernear 0.03 7 -> 0.03 330 rmnx351 remaindernear 5 2 -> 1 331 rmnx352 remaindernear 4.1 2 -> 0.1 332 rmnx353 remaindernear 4.01 2 -> 0.01 333 rmnx354 remaindernear 4.001 2 -> 0.001 334 rmnx355 remaindernear 4.0001 2 -> 0.0001 335 rmnx356 remaindernear 4.00001 2 -> 0.00001 336 rmnx357 remaindernear 4.000001 2 -> 0.000001 337 rmnx358 remaindernear 4.0000001 2 -> 1E-7 338 339 rmnx360 remaindernear 1.2 0.7345 -> -0.2690 340 rmnx361 remaindernear 0.8 12 -> 0.8 341 rmnx362 remaindernear 0.8 0.2 -> 0.0 342 rmnx363 remaindernear 0.8 0.3 -> -0.1 343 rmnx364 remaindernear 0.800 12 -> 0.800 344 rmnx365 remaindernear 0.800 1.7 -> 0.800 345 rmnx366 remaindernear 2.400 2 -> 0.400 346 347 precision: 6 348 rmnx371 remaindernear 2.400 2 -> 0.400 349 precision: 3 350 rmnx372 remaindernear 12345678900000 12e+12 -> 3.46E+11 Inexact Rounded 351 352 precision: 5 353 rmnx381 remaindernear 12345 1 -> 0 354 rmnx382 remaindernear 12345 1.0001 -> -0.2344 355 rmnx383 remaindernear 12345 1.001 -> -0.333 356 rmnx384 remaindernear 12345 1.01 -> -0.23 357 rmnx385 remaindernear 12345 1.1 -> -0.3 358 rmnx386 remaindernear 12355 4 -> -1 359 rmnx387 remaindernear 12345 4 -> 1 360 rmnx388 remaindernear 12355 4.0001 -> -1.3089 361 rmnx389 remaindernear 12345 4.0001 -> 0.6914 362 rmnx390 remaindernear 12345 4.9 -> 1.9 363 rmnx391 remaindernear 12345 4.99 -> -0.26 364 rmnx392 remaindernear 12345 4.999 -> 2.469 365 rmnx393 remaindernear 12345 4.9999 -> 0.2469 366 rmnx394 remaindernear 12345 5 -> 0 367 rmnx395 remaindernear 12345 5.0001 -> -0.2469 368 rmnx396 remaindernear 12345 5.001 -> -2.469 369 rmnx397 remaindernear 12345 5.01 -> 0.36 370 rmnx398 remaindernear 12345 5.1 -> -2.1 371 372 precision: 9 373 -- some nasty division-by-1 cases [some similar above] 374 rmnx401 remaindernear 0.4 1 -> 0.4 375 rmnx402 remaindernear 0.45 1 -> 0.45 376 rmnx403 remaindernear 0.455 1 -> 0.455 377 rmnx404 remaindernear 0.4555 1 -> 0.4555 378 rmnx405 remaindernear 0.45555 1 -> 0.45555 379 rmnx406 remaindernear 0.455555 1 -> 0.455555 380 rmnx407 remaindernear 0.4555555 1 -> 0.4555555 381 rmnx408 remaindernear 0.45555555 1 -> 0.45555555 382 rmnx409 remaindernear 0.455555555 1 -> 0.455555555 383 384 -- some tricky LHSs 385 rmnx420 remaindernear 99999999.999999999 1E+8 -> -1E-9 386 rmnx421 remaindernear 999999999.999999999 1E+9 -> -1E-9 387 precision: 9 388 rmnx430 remaindernear 0.455555555 1 -> 0.455555555 389 precision: 8 390 rmnx431 remaindernear 0.455555555 1 -> 0.45555556 Inexact Rounded 391 precision: 7 392 rmnx432 remaindernear 0.455555555 1 -> 0.4555556 Inexact Rounded 393 precision: 6 394 rmnx433 remaindernear 0.455555555 1 -> 0.455556 Inexact Rounded 395 precision: 5 396 rmnx434 remaindernear 0.455555555 1 -> 0.45556 Inexact Rounded 397 precision: 4 398 rmnx435 remaindernear 0.455555555 1 -> 0.4556 Inexact Rounded 399 precision: 3 400 rmnx436 remaindernear 0.455555555 1 -> 0.456 Inexact Rounded 401 precision: 2 402 rmnx437 remaindernear 0.455555555 1 -> 0.46 Inexact Rounded 403 precision: 1 404 rmnx438 remaindernear 0.455555555 1 -> 0.5 Inexact Rounded 405 406 -- early tests; from text descriptions 407 precision: 9 408 rmnx601 remaindernear 10 6 -> -2 409 rmnx602 remaindernear -10 6 -> 2 410 rmnx603 remaindernear 11 3 -> -1 411 rmnx604 remaindernear 11 5 -> 1 412 rmnx605 remaindernear 7.7 8 -> -0.3 413 rmnx606 remaindernear 31.5 3 -> 1.5 -- i=10 414 rmnx607 remaindernear 34.5 3 -> -1.5 -- i=11 415 416 -- zero signs 417 rmnx650 remaindernear 1 1 -> 0 418 rmnx651 remaindernear -1 1 -> -0 419 rmnx652 remaindernear 1 -1 -> 0 420 rmnx653 remaindernear -1 -1 -> -0 421 rmnx654 remaindernear 0 1 -> 0 422 rmnx655 remaindernear -0 1 -> -0 423 rmnx656 remaindernear 0 -1 -> 0 424 rmnx657 remaindernear -0 -1 -> -0 425 rmnx658 remaindernear 0.00 1 -> 0.00 426 rmnx659 remaindernear -0.00 1 -> -0.00 427 428 -- Specials 429 rmnx680 remaindernear Inf -Inf -> NaN Invalid_operation 430 rmnx681 remaindernear Inf -1000 -> NaN Invalid_operation 431 rmnx682 remaindernear Inf -1 -> NaN Invalid_operation 432 rmnx683 remaindernear Inf 0 -> NaN Invalid_operation 433 rmnx684 remaindernear Inf -0 -> NaN Invalid_operation 434 rmnx685 remaindernear Inf 1 -> NaN Invalid_operation 435 rmnx686 remaindernear Inf 1000 -> NaN Invalid_operation 436 rmnx687 remaindernear Inf Inf -> NaN Invalid_operation 437 rmnx688 remaindernear -1000 Inf -> -1000 438 rmnx689 remaindernear -Inf Inf -> NaN Invalid_operation 439 rmnx691 remaindernear -1 Inf -> -1 440 rmnx692 remaindernear 0 Inf -> 0 441 rmnx693 remaindernear -0 Inf -> -0 442 rmnx694 remaindernear 1 Inf -> 1 443 rmnx695 remaindernear 1000 Inf -> 1000 444 rmnx696 remaindernear Inf Inf -> NaN Invalid_operation 445 446 rmnx700 remaindernear -Inf -Inf -> NaN Invalid_operation 447 rmnx701 remaindernear -Inf -1000 -> NaN Invalid_operation 448 rmnx702 remaindernear -Inf -1 -> NaN Invalid_operation 449 rmnx703 remaindernear -Inf -0 -> NaN Invalid_operation 450 rmnx704 remaindernear -Inf 0 -> NaN Invalid_operation 451 rmnx705 remaindernear -Inf 1 -> NaN Invalid_operation 452 rmnx706 remaindernear -Inf 1000 -> NaN Invalid_operation 453 rmnx707 remaindernear -Inf Inf -> NaN Invalid_operation 454 rmnx708 remaindernear -Inf -Inf -> NaN Invalid_operation 455 rmnx709 remaindernear -1000 Inf -> -1000 456 rmnx710 remaindernear -1 -Inf -> -1 457 rmnx711 remaindernear -0 -Inf -> -0 458 rmnx712 remaindernear 0 -Inf -> 0 459 rmnx713 remaindernear 1 -Inf -> 1 460 rmnx714 remaindernear 1000 -Inf -> 1000 461 rmnx715 remaindernear Inf -Inf -> NaN Invalid_operation 462 463 rmnx721 remaindernear NaN -Inf -> NaN 464 rmnx722 remaindernear NaN -1000 -> NaN 465 rmnx723 remaindernear NaN -1 -> NaN 466 rmnx724 remaindernear NaN -0 -> NaN 467 rmnx725 remaindernear NaN 0 -> NaN 468 rmnx726 remaindernear NaN 1 -> NaN 469 rmnx727 remaindernear NaN 1000 -> NaN 470 rmnx728 remaindernear NaN Inf -> NaN 471 rmnx729 remaindernear NaN NaN -> NaN 472 rmnx730 remaindernear -Inf NaN -> NaN 473 rmnx731 remaindernear -1000 NaN -> NaN 474 rmnx732 remaindernear -1 -NaN -> -NaN 475 rmnx733 remaindernear -0 NaN -> NaN 476 rmnx734 remaindernear 0 NaN -> NaN 477 rmnx735 remaindernear 1 NaN -> NaN 478 rmnx736 remaindernear 1000 NaN -> NaN 479 rmnx737 remaindernear Inf NaN -> NaN 480 481 rmnx741 remaindernear sNaN -Inf -> NaN Invalid_operation 482 rmnx742 remaindernear sNaN -1000 -> NaN Invalid_operation 483 rmnx743 remaindernear -sNaN -1 -> -NaN Invalid_operation 484 rmnx744 remaindernear sNaN -0 -> NaN Invalid_operation 485 rmnx745 remaindernear sNaN 0 -> NaN Invalid_operation 486 rmnx746 remaindernear sNaN 1 -> NaN Invalid_operation 487 rmnx747 remaindernear sNaN 1000 -> NaN Invalid_operation 488 rmnx749 remaindernear sNaN NaN -> NaN Invalid_operation 489 rmnx750 remaindernear sNaN sNaN -> NaN Invalid_operation 490 rmnx751 remaindernear NaN sNaN -> NaN Invalid_operation 491 rmnx752 remaindernear -Inf sNaN -> NaN Invalid_operation 492 rmnx753 remaindernear -1000 sNaN -> NaN Invalid_operation 493 rmnx754 remaindernear -1 sNaN -> NaN Invalid_operation 494 rmnx755 remaindernear -0 -sNaN -> -NaN Invalid_operation 495 rmnx756 remaindernear 0 sNaN -> NaN Invalid_operation 496 rmnx757 remaindernear 1 sNaN -> NaN Invalid_operation 497 rmnx758 remaindernear 1000 sNaN -> NaN Invalid_operation 498 rmnx759 remaindernear Inf sNaN -> NaN Invalid_operation 499 rmnx760 remaindernear NaN sNaN -> NaN Invalid_operation 500 501 -- propaging NaNs 502 rmnx761 remaindernear NaN1 NaN7 -> NaN1 503 rmnx762 remaindernear sNaN2 NaN8 -> NaN2 Invalid_operation 504 rmnx763 remaindernear NaN3 -sNaN9 -> -NaN9 Invalid_operation 505 rmnx764 remaindernear sNaN4 sNaN10 -> NaN4 Invalid_operation 506 rmnx765 remaindernear 15 NaN11 -> NaN11 507 rmnx766 remaindernear NaN6 NaN12 -> NaN6 508 rmnx767 remaindernear Inf -NaN13 -> -NaN13 509 rmnx768 remaindernear NaN14 -Inf -> NaN14 510 rmnx769 remaindernear 0 NaN15 -> NaN15 511 rmnx770 remaindernear -NaN16 -0 -> -NaN16 512 513 -- test some cases that are close to exponent overflow 514 maxexponent: 999999999 515 minexponent: -999999999 516 rmnx780 remaindernear 1 1e999999999 -> 1 517 rmnx781 remaindernear 1 0.9e999999999 -> 1 518 rmnx782 remaindernear 1 0.99e999999999 -> 1 519 rmnx783 remaindernear 1 0.999999999e999999999 -> 1 520 rmnx784 remaindernear 9e999999999 1 -> NaN Division_impossible 521 rmnx785 remaindernear 9.9e999999999 1 -> NaN Division_impossible 522 rmnx786 remaindernear 9.99e999999999 1 -> NaN Division_impossible 523 rmnx787 remaindernear 9.99999999e999999999 1 -> NaN Division_impossible 524 525 526 -- overflow and underflow tests [from divide] 527 precision: 9 528 maxexponent: 999999999 529 minexponent: -999999999 530 rmnx790 remaindernear +1.23456789012345E-0 9E+999999999 -> 1.23456789 Inexact Rounded 531 rmnx791 remaindernear 9E+999999999 +0.23456789012345E-0 -> NaN Division_impossible 532 rmnx792 remaindernear +0.100 9E+999999999 -> 0.100 533 rmnx793 remaindernear 9E-999999999 +9.100 -> 9E-999999999 534 rmnx795 remaindernear -1.23456789012345E-0 9E+999999999 -> -1.23456789 Inexact Rounded 535 rmnx796 remaindernear 9E+999999999 -0.83456789012345E-0 -> NaN Division_impossible 536 rmnx797 remaindernear -0.100 9E+999999999 -> -0.100 537 rmnx798 remaindernear 9E-999999999 -9.100 -> 9E-999999999 538 539 -- long operands checks 540 maxexponent: 999 541 minexponent: -999 542 precision: 9 543 rmnx801 remaindernear 12345678000 100 -> 0 544 rmnx802 remaindernear 1 12345678000 -> 1 545 rmnx803 remaindernear 1234567800 10 -> 0 546 rmnx804 remaindernear 1 1234567800 -> 1 547 rmnx805 remaindernear 1234567890 10 -> 0 548 rmnx806 remaindernear 1 1234567890 -> 1 549 rmnx807 remaindernear 1234567891 10 -> 1 550 rmnx808 remaindernear 1 1234567891 -> 1 551 rmnx809 remaindernear 12345678901 100 -> 1 552 rmnx810 remaindernear 1 12345678901 -> 1 553 rmnx811 remaindernear 1234567896 10 -> -4 554 rmnx812 remaindernear 1 1234567896 -> 1 555 556 precision: 15 557 rmnx841 remaindernear 12345678000 100 -> 0 558 rmnx842 remaindernear 1 12345678000 -> 1 559 rmnx843 remaindernear 1234567800 10 -> 0 560 rmnx844 remaindernear 1 1234567800 -> 1 561 rmnx845 remaindernear 1234567890 10 -> 0 562 rmnx846 remaindernear 1 1234567890 -> 1 563 rmnx847 remaindernear 1234567891 10 -> 1 564 rmnx848 remaindernear 1 1234567891 -> 1 565 rmnx849 remaindernear 12345678901 100 -> 1 566 rmnx850 remaindernear 1 12345678901 -> 1 567 rmnx851 remaindernear 1234567896 10 -> -4 568 rmnx852 remaindernear 1 1234567896 -> 1 569 570 -- Null tests 571 rmnx900 remaindernear 10 # -> NaN Invalid_operation 572 rmnx901 remaindernear # 10 -> NaN Invalid_operation 573