1 ------------------------------------------------------------------------ 2 -- remainder.decTest -- decimal 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 -- sanity checks (as base, above) 29 remx001 remainder 1 1 -> 0 30 remx002 remainder 2 1 -> 0 31 remx003 remainder 1 2 -> 1 32 remx004 remainder 2 2 -> 0 33 remx005 remainder 0 1 -> 0 34 remx006 remainder 0 2 -> 0 35 remx007 remainder 1 3 -> 1 36 remx008 remainder 2 3 -> 2 37 remx009 remainder 3 3 -> 0 38 39 remx010 remainder 2.4 1 -> 0.4 40 remx011 remainder 2.4 -1 -> 0.4 41 remx012 remainder -2.4 1 -> -0.4 42 remx013 remainder -2.4 -1 -> -0.4 43 remx014 remainder 2.40 1 -> 0.40 44 remx015 remainder 2.400 1 -> 0.400 45 remx016 remainder 2.4 2 -> 0.4 46 remx017 remainder 2.400 2 -> 0.400 47 remx018 remainder 2. 2 -> 0 48 remx019 remainder 20 20 -> 0 49 50 remx020 remainder 187 187 -> 0 51 remx021 remainder 5 2 -> 1 52 remx022 remainder 5 2.0 -> 1.0 53 remx023 remainder 5 2.000 -> 1.000 54 remx024 remainder 5 0.200 -> 0.000 55 remx025 remainder 5 0.200 -> 0.000 56 57 remx030 remainder 1 2 -> 1 58 remx031 remainder 1 4 -> 1 59 remx032 remainder 1 8 -> 1 60 61 remx033 remainder 1 16 -> 1 62 remx034 remainder 1 32 -> 1 63 remx035 remainder 1 64 -> 1 64 remx040 remainder 1 -2 -> 1 65 remx041 remainder 1 -4 -> 1 66 remx042 remainder 1 -8 -> 1 67 remx043 remainder 1 -16 -> 1 68 remx044 remainder 1 -32 -> 1 69 remx045 remainder 1 -64 -> 1 70 remx050 remainder -1 2 -> -1 71 remx051 remainder -1 4 -> -1 72 remx052 remainder -1 8 -> -1 73 remx053 remainder -1 16 -> -1 74 remx054 remainder -1 32 -> -1 75 remx055 remainder -1 64 -> -1 76 remx060 remainder -1 -2 -> -1 77 remx061 remainder -1 -4 -> -1 78 remx062 remainder -1 -8 -> -1 79 remx063 remainder -1 -16 -> -1 80 remx064 remainder -1 -32 -> -1 81 remx065 remainder -1 -64 -> -1 82 83 remx066 remainder 999999999 1 -> 0 84 remx067 remainder 999999999.4 1 -> 0.4 85 remx068 remainder 999999999.5 1 -> 0.5 86 remx069 remainder 999999999.9 1 -> 0.9 87 remx070 remainder 999999999.999 1 -> 0.999 88 precision: 6 89 remx071 remainder 999999999 1 -> NaN Division_impossible 90 remx072 remainder 99999999 1 -> NaN Division_impossible 91 remx073 remainder 9999999 1 -> NaN Division_impossible 92 remx074 remainder 999999 1 -> 0 93 remx075 remainder 99999 1 -> 0 94 remx076 remainder 9999 1 -> 0 95 remx077 remainder 999 1 -> 0 96 remx078 remainder 99 1 -> 0 97 remx079 remainder 9 1 -> 0 98 99 precision: 9 100 remx080 remainder 0. 1 -> 0 101 remx081 remainder .0 1 -> 0.0 102 remx082 remainder 0.00 1 -> 0.00 103 remx083 remainder 0.00E+9 1 -> 0 104 remx084 remainder 0.00E+3 1 -> 0 105 remx085 remainder 0.00E+2 1 -> 0 106 remx086 remainder 0.00E+1 1 -> 0.0 107 remx087 remainder 0.00E+0 1 -> 0.00 108 remx088 remainder 0.00E-0 1 -> 0.00 109 remx089 remainder 0.00E-1 1 -> 0.000 110 remx090 remainder 0.00E-2 1 -> 0.0000 111 remx091 remainder 0.00E-3 1 -> 0.00000 112 remx092 remainder 0.00E-4 1 -> 0.000000 113 remx093 remainder 0.00E-5 1 -> 0E-7 114 remx094 remainder 0.00E-6 1 -> 0E-8 115 remx095 remainder 0.0000E-50 1 -> 0E-54 116 117 -- Various flavours of remainder by 0 118 precision: 9 119 maxexponent: 999999999 120 minexponent: -999999999 121 remx101 remainder 0 0 -> NaN Division_undefined 122 remx102 remainder 0 -0 -> NaN Division_undefined 123 remx103 remainder -0 0 -> NaN Division_undefined 124 remx104 remainder -0 -0 -> NaN Division_undefined 125 remx105 remainder 0.0E5 0 -> NaN Division_undefined 126 remx106 remainder 0.000 0 -> NaN Division_undefined 127 -- [Some think this next group should be Division_by_zero exception, but 128 -- IEEE 854 is explicit that it is Invalid operation .. for 129 -- remainder-near, anyway] 130 remx107 remainder 0.0001 0 -> NaN Invalid_operation 131 remx108 remainder 0.01 0 -> NaN Invalid_operation 132 remx109 remainder 0.1 0 -> NaN Invalid_operation 133 remx110 remainder 1 0 -> NaN Invalid_operation 134 remx111 remainder 1 0.0 -> NaN Invalid_operation 135 remx112 remainder 10 0.0 -> NaN Invalid_operation 136 remx113 remainder 1E+100 0.0 -> NaN Invalid_operation 137 remx114 remainder 1E+1000 0 -> NaN Invalid_operation 138 remx115 remainder 0.0001 -0 -> NaN Invalid_operation 139 remx116 remainder 0.01 -0 -> NaN Invalid_operation 140 remx119 remainder 0.1 -0 -> NaN Invalid_operation 141 remx120 remainder 1 -0 -> NaN Invalid_operation 142 remx121 remainder 1 -0.0 -> NaN Invalid_operation 143 remx122 remainder 10 -0.0 -> NaN Invalid_operation 144 remx123 remainder 1E+100 -0.0 -> NaN Invalid_operation 145 remx124 remainder 1E+1000 -0 -> NaN Invalid_operation 146 -- and zeros on left 147 remx130 remainder 0 1 -> 0 148 remx131 remainder 0 -1 -> 0 149 remx132 remainder 0.0 1 -> 0.0 150 remx133 remainder 0.0 -1 -> 0.0 151 remx134 remainder -0 1 -> -0 152 remx135 remainder -0 -1 -> -0 153 remx136 remainder -0.0 1 -> -0.0 154 remx137 remainder -0.0 -1 -> -0.0 155 156 -- 0.5ers 157 remx143 remainder 0.5 2 -> 0.5 158 remx144 remainder 0.5 2.1 -> 0.5 159 remx145 remainder 0.5 2.01 -> 0.50 160 remx146 remainder 0.5 2.001 -> 0.500 161 remx147 remainder 0.50 2 -> 0.50 162 remx148 remainder 0.50 2.01 -> 0.50 163 remx149 remainder 0.50 2.001 -> 0.500 164 165 -- steadies 166 remx150 remainder 1 1 -> 0 167 remx151 remainder 1 2 -> 1 168 remx152 remainder 1 3 -> 1 169 remx153 remainder 1 4 -> 1 170 remx154 remainder 1 5 -> 1 171 remx155 remainder 1 6 -> 1 172 remx156 remainder 1 7 -> 1 173 remx157 remainder 1 8 -> 1 174 remx158 remainder 1 9 -> 1 175 remx159 remainder 1 10 -> 1 176 remx160 remainder 1 1 -> 0 177 remx161 remainder 2 1 -> 0 178 remx162 remainder 3 1 -> 0 179 remx163 remainder 4 1 -> 0 180 remx164 remainder 5 1 -> 0 181 remx165 remainder 6 1 -> 0 182 remx166 remainder 7 1 -> 0 183 remx167 remainder 8 1 -> 0 184 remx168 remainder 9 1 -> 0 185 remx169 remainder 10 1 -> 0 186 187 -- some differences from remainderNear 188 remx171 remainder 0.4 1.020 -> 0.400 189 remx172 remainder 0.50 1.020 -> 0.500 190 remx173 remainder 0.51 1.020 -> 0.510 191 remx174 remainder 0.52 1.020 -> 0.520 192 remx175 remainder 0.6 1.020 -> 0.600 193 194 195 -- More flavours of remainder by 0 196 maxexponent: 999999999 197 minexponent: -999999999 198 remx201 remainder 0 0 -> NaN Division_undefined 199 remx202 remainder 0.0E5 0 -> NaN Division_undefined 200 remx203 remainder 0.000 0 -> NaN Division_undefined 201 remx204 remainder 0.0001 0 -> NaN Invalid_operation 202 remx205 remainder 0.01 0 -> NaN Invalid_operation 203 remx206 remainder 0.1 0 -> NaN Invalid_operation 204 remx207 remainder 1 0 -> NaN Invalid_operation 205 remx208 remainder 1 0.0 -> NaN Invalid_operation 206 remx209 remainder 10 0.0 -> NaN Invalid_operation 207 remx210 remainder 1E+100 0.0 -> NaN Invalid_operation 208 remx211 remainder 1E+1000 0 -> NaN Invalid_operation 209 210 -- some differences from remainderNear 211 remx231 remainder -0.4 1.020 -> -0.400 212 remx232 remainder -0.50 1.020 -> -0.500 213 remx233 remainder -0.51 1.020 -> -0.510 214 remx234 remainder -0.52 1.020 -> -0.520 215 remx235 remainder -0.6 1.020 -> -0.600 216 217 -- high Xs 218 remx240 remainder 1E+2 1.00 -> 0.00 219 220 221 -- test some cases that are close to exponent overflow 222 maxexponent: 999999999 223 minexponent: -999999999 224 remx270 remainder 1 1e999999999 -> 1 225 remx271 remainder 1 0.9e999999999 -> 1 226 remx272 remainder 1 0.99e999999999 -> 1 227 remx273 remainder 1 0.999999999e999999999 -> 1 228 remx274 remainder 9e999999999 1 -> NaN Division_impossible 229 remx275 remainder 9.9e999999999 1 -> NaN Division_impossible 230 remx276 remainder 9.99e999999999 1 -> NaN Division_impossible 231 remx277 remainder 9.99999999e999999999 1 -> NaN Division_impossible 232 233 remx280 remainder 0.1 9e-999999999 -> NaN Division_impossible 234 remx281 remainder 0.1 99e-999999999 -> NaN Division_impossible 235 remx282 remainder 0.1 999e-999999999 -> NaN Division_impossible 236 237 remx283 remainder 0.1 9e-999999998 -> NaN Division_impossible 238 remx284 remainder 0.1 99e-999999998 -> NaN Division_impossible 239 remx285 remainder 0.1 999e-999999998 -> NaN Division_impossible 240 remx286 remainder 0.1 999e-999999997 -> NaN Division_impossible 241 remx287 remainder 0.1 9999e-999999997 -> NaN Division_impossible 242 remx288 remainder 0.1 99999e-999999997 -> NaN Division_impossible 243 244 -- remx3xx are from DiagBigDecimal 245 remx301 remainder 1 3 -> 1 246 remx302 remainder 5 5 -> 0 247 remx303 remainder 13 10 -> 3 248 remx304 remainder 13 50 -> 13 249 remx305 remainder 13 100 -> 13 250 remx306 remainder 13 1000 -> 13 251 remx307 remainder .13 1 -> 0.13 252 remx308 remainder 0.133 1 -> 0.133 253 remx309 remainder 0.1033 1 -> 0.1033 254 remx310 remainder 1.033 1 -> 0.033 255 remx311 remainder 10.33 1 -> 0.33 256 remx312 remainder 10.33 10 -> 0.33 257 remx313 remainder 103.3 1 -> 0.3 258 remx314 remainder 133 10 -> 3 259 remx315 remainder 1033 10 -> 3 260 remx316 remainder 1033 50 -> 33 261 remx317 remainder 101.0 3 -> 2.0 262 remx318 remainder 102.0 3 -> 0.0 263 remx319 remainder 103.0 3 -> 1.0 264 remx320 remainder 2.40 1 -> 0.40 265 remx321 remainder 2.400 1 -> 0.400 266 remx322 remainder 2.4 1 -> 0.4 267 remx323 remainder 2.4 2 -> 0.4 268 remx324 remainder 2.400 2 -> 0.400 269 remx325 remainder 1 0.3 -> 0.1 270 remx326 remainder 1 0.30 -> 0.10 271 remx327 remainder 1 0.300 -> 0.100 272 remx328 remainder 1 0.3000 -> 0.1000 273 remx329 remainder 1.0 0.3 -> 0.1 274 remx330 remainder 1.00 0.3 -> 0.10 275 remx331 remainder 1.000 0.3 -> 0.100 276 remx332 remainder 1.0000 0.3 -> 0.1000 277 remx333 remainder 0.5 2 -> 0.5 278 remx334 remainder 0.5 2.1 -> 0.5 279 remx335 remainder 0.5 2.01 -> 0.50 280 remx336 remainder 0.5 2.001 -> 0.500 281 remx337 remainder 0.50 2 -> 0.50 282 remx338 remainder 0.50 2.01 -> 0.50 283 remx339 remainder 0.50 2.001 -> 0.500 284 285 remx340 remainder 0.5 0.5000001 -> 0.5000000 286 remx341 remainder 0.5 0.50000001 -> 0.50000000 287 remx342 remainder 0.5 0.500000001 -> 0.500000000 288 remx343 remainder 0.5 0.5000000001 -> 0.500000000 Rounded 289 remx344 remainder 0.5 0.50000000001 -> 0.500000000 Rounded 290 remx345 remainder 0.5 0.4999999 -> 1E-7 291 remx346 remainder 0.5 0.49999999 -> 1E-8 292 remx347 remainder 0.5 0.499999999 -> 1E-9 293 remx348 remainder 0.5 0.4999999999 -> 1E-10 294 remx349 remainder 0.5 0.49999999999 -> 1E-11 295 remx350 remainder 0.5 0.499999999999 -> 1E-12 296 297 remx351 remainder 0.03 7 -> 0.03 298 remx352 remainder 5 2 -> 1 299 remx353 remainder 4.1 2 -> 0.1 300 remx354 remainder 4.01 2 -> 0.01 301 remx355 remainder 4.001 2 -> 0.001 302 remx356 remainder 4.0001 2 -> 0.0001 303 remx357 remainder 4.00001 2 -> 0.00001 304 remx358 remainder 4.000001 2 -> 0.000001 305 remx359 remainder 4.0000001 2 -> 1E-7 306 307 remx360 remainder 1.2 0.7345 -> 0.4655 308 remx361 remainder 0.8 12 -> 0.8 309 remx362 remainder 0.8 0.2 -> 0.0 310 remx363 remainder 0.8 0.3 -> 0.2 311 remx364 remainder 0.800 12 -> 0.800 312 remx365 remainder 0.800 1.7 -> 0.800 313 remx366 remainder 2.400 2 -> 0.400 314 315 precision: 6 316 remx371 remainder 2.400 2 -> 0.400 317 precision: 3 318 -- long operand, rounded, case 319 remx372 remainder 12345678900000 12e+12 -> 3.46E+11 Inexact Rounded 320 -- 12000000000000 321 322 precision: 5 323 remx381 remainder 12345 1 -> 0 324 remx382 remainder 12345 1.0001 -> 0.7657 325 remx383 remainder 12345 1.001 -> 0.668 326 remx384 remainder 12345 1.01 -> 0.78 327 remx385 remainder 12345 1.1 -> 0.8 328 remx386 remainder 12355 4 -> 3 329 remx387 remainder 12345 4 -> 1 330 remx388 remainder 12355 4.0001 -> 2.6912 331 remx389 remainder 12345 4.0001 -> 0.6914 332 remx390 remainder 12345 4.9 -> 1.9 333 remx391 remainder 12345 4.99 -> 4.73 334 remx392 remainder 12345 4.999 -> 2.469 335 remx393 remainder 12345 4.9999 -> 0.2469 336 remx394 remainder 12345 5 -> 0 337 remx395 remainder 12345 5.0001 -> 4.7532 338 remx396 remainder 12345 5.001 -> 2.532 339 remx397 remainder 12345 5.01 -> 0.36 340 remx398 remainder 12345 5.1 -> 3.0 341 342 precision: 9 343 -- the nasty division-by-1 cases 344 remx401 remainder 0.5 1 -> 0.5 345 remx402 remainder 0.55 1 -> 0.55 346 remx403 remainder 0.555 1 -> 0.555 347 remx404 remainder 0.5555 1 -> 0.5555 348 remx405 remainder 0.55555 1 -> 0.55555 349 remx406 remainder 0.555555 1 -> 0.555555 350 remx407 remainder 0.5555555 1 -> 0.5555555 351 remx408 remainder 0.55555555 1 -> 0.55555555 352 remx409 remainder 0.555555555 1 -> 0.555555555 353 354 -- zero signs 355 remx650 remainder 1 1 -> 0 356 remx651 remainder -1 1 -> -0 357 remx652 remainder 1 -1 -> 0 358 remx653 remainder -1 -1 -> -0 359 remx654 remainder 0 1 -> 0 360 remx655 remainder -0 1 -> -0 361 remx656 remainder 0 -1 -> 0 362 remx657 remainder -0 -1 -> -0 363 remx658 remainder 0.00 1 -> 0.00 364 remx659 remainder -0.00 1 -> -0.00 365 366 -- Specials 367 remx680 remainder Inf -Inf -> NaN Invalid_operation 368 remx681 remainder Inf -1000 -> NaN Invalid_operation 369 remx682 remainder Inf -1 -> NaN Invalid_operation 370 remx683 remainder Inf 0 -> NaN Invalid_operation 371 remx684 remainder Inf -0 -> NaN Invalid_operation 372 remx685 remainder Inf 1 -> NaN Invalid_operation 373 remx686 remainder Inf 1000 -> NaN Invalid_operation 374 remx687 remainder Inf Inf -> NaN Invalid_operation 375 remx688 remainder -1000 Inf -> -1000 376 remx689 remainder -Inf Inf -> NaN Invalid_operation 377 remx691 remainder -1 Inf -> -1 378 remx692 remainder 0 Inf -> 0 379 remx693 remainder -0 Inf -> -0 380 remx694 remainder 1 Inf -> 1 381 remx695 remainder 1000 Inf -> 1000 382 remx696 remainder Inf Inf -> NaN Invalid_operation 383 384 remx700 remainder -Inf -Inf -> NaN Invalid_operation 385 remx701 remainder -Inf -1000 -> NaN Invalid_operation 386 remx702 remainder -Inf -1 -> NaN Invalid_operation 387 remx703 remainder -Inf -0 -> NaN Invalid_operation 388 remx704 remainder -Inf 0 -> NaN Invalid_operation 389 remx705 remainder -Inf 1 -> NaN Invalid_operation 390 remx706 remainder -Inf 1000 -> NaN Invalid_operation 391 remx707 remainder -Inf Inf -> NaN Invalid_operation 392 remx708 remainder -Inf -Inf -> NaN Invalid_operation 393 remx709 remainder -1000 Inf -> -1000 394 remx710 remainder -1 -Inf -> -1 395 remx711 remainder -0 -Inf -> -0 396 remx712 remainder 0 -Inf -> 0 397 remx713 remainder 1 -Inf -> 1 398 remx714 remainder 1000 -Inf -> 1000 399 remx715 remainder Inf -Inf -> NaN Invalid_operation 400 401 remx721 remainder NaN -Inf -> NaN 402 remx722 remainder NaN -1000 -> NaN 403 remx723 remainder NaN -1 -> NaN 404 remx724 remainder NaN -0 -> NaN 405 remx725 remainder -NaN 0 -> -NaN 406 remx726 remainder NaN 1 -> NaN 407 remx727 remainder NaN 1000 -> NaN 408 remx728 remainder NaN Inf -> NaN 409 remx729 remainder NaN -NaN -> NaN 410 remx730 remainder -Inf NaN -> NaN 411 remx731 remainder -1000 NaN -> NaN 412 remx732 remainder -1 NaN -> NaN 413 remx733 remainder -0 -NaN -> -NaN 414 remx734 remainder 0 NaN -> NaN 415 remx735 remainder 1 -NaN -> -NaN 416 remx736 remainder 1000 NaN -> NaN 417 remx737 remainder Inf NaN -> NaN 418 419 remx741 remainder sNaN -Inf -> NaN Invalid_operation 420 remx742 remainder sNaN -1000 -> NaN Invalid_operation 421 remx743 remainder -sNaN -1 -> -NaN Invalid_operation 422 remx744 remainder sNaN -0 -> NaN Invalid_operation 423 remx745 remainder sNaN 0 -> NaN Invalid_operation 424 remx746 remainder sNaN 1 -> NaN Invalid_operation 425 remx747 remainder sNaN 1000 -> NaN Invalid_operation 426 remx749 remainder sNaN NaN -> NaN Invalid_operation 427 remx750 remainder sNaN sNaN -> NaN Invalid_operation 428 remx751 remainder NaN sNaN -> NaN Invalid_operation 429 remx752 remainder -Inf sNaN -> NaN Invalid_operation 430 remx753 remainder -1000 sNaN -> NaN Invalid_operation 431 remx754 remainder -1 sNaN -> NaN Invalid_operation 432 remx755 remainder -0 sNaN -> NaN Invalid_operation 433 remx756 remainder 0 sNaN -> NaN Invalid_operation 434 remx757 remainder 1 sNaN -> NaN Invalid_operation 435 remx758 remainder 1000 sNaN -> NaN Invalid_operation 436 remx759 remainder Inf -sNaN -> -NaN Invalid_operation 437 438 -- propaging NaNs 439 remx760 remainder NaN1 NaN7 -> NaN1 440 remx761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation 441 remx762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation 442 remx763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation 443 remx764 remainder 15 NaN11 -> NaN11 444 remx765 remainder NaN6 NaN12 -> NaN6 445 remx766 remainder Inf NaN13 -> NaN13 446 remx767 remainder NaN14 -Inf -> NaN14 447 remx768 remainder 0 NaN15 -> NaN15 448 remx769 remainder NaN16 -0 -> NaN16 449 450 -- test some cases that are close to exponent overflow 451 maxexponent: 999999999 452 minexponent: -999999999 453 remx770 remainder 1 1e999999999 -> 1 454 remx771 remainder 1 0.9e999999999 -> 1 455 remx772 remainder 1 0.99e999999999 -> 1 456 remx773 remainder 1 0.999999999e999999999 -> 1 457 remx774 remainder 9e999999999 1 -> NaN Division_impossible 458 remx775 remainder 9.9e999999999 1 -> NaN Division_impossible 459 remx776 remainder 9.99e999999999 1 -> NaN Division_impossible 460 remx777 remainder 9.99999999e999999999 1 -> NaN Division_impossible 461 462 -- long operand checks 463 maxexponent: 999 464 minexponent: -999 465 precision: 9 466 remx801 remainder 12345678000 100 -> 0 467 remx802 remainder 1 12345678000 -> 1 468 remx803 remainder 1234567800 10 -> 0 469 remx804 remainder 1 1234567800 -> 1 470 remx805 remainder 1234567890 10 -> 0 471 remx806 remainder 1 1234567890 -> 1 472 remx807 remainder 1234567891 10 -> 1 473 remx808 remainder 1 1234567891 -> 1 474 remx809 remainder 12345678901 100 -> 1 475 remx810 remainder 1 12345678901 -> 1 476 remx811 remainder 1234567896 10 -> 6 477 remx812 remainder 1 1234567896 -> 1 478 479 precision: 15 480 remx821 remainder 12345678000 100 -> 0 481 remx822 remainder 1 12345678000 -> 1 482 remx823 remainder 1234567800 10 -> 0 483 remx824 remainder 1 1234567800 -> 1 484 remx825 remainder 1234567890 10 -> 0 485 remx826 remainder 1 1234567890 -> 1 486 remx827 remainder 1234567891 10 -> 1 487 remx828 remainder 1 1234567891 -> 1 488 remx829 remainder 12345678901 100 -> 1 489 remx830 remainder 1 12345678901 -> 1 490 remx831 remainder 1234567896 10 -> 6 491 remx832 remainder 1 1234567896 -> 1 492 493 -- worries from divideint 494 precision: 8 495 remx840 remainder 100000000.0 1 -> NaN Division_impossible 496 remx841 remainder 100000000.4 1 -> NaN Division_impossible 497 remx842 remainder 100000000.5 1 -> NaN Division_impossible 498 remx843 remainder 100000000.9 1 -> NaN Division_impossible 499 remx844 remainder 100000000.999 1 -> NaN Division_impossible 500 precision: 6 501 remx850 remainder 100000003 5 -> NaN Division_impossible 502 remx851 remainder 10000003 5 -> NaN Division_impossible 503 remx852 remainder 1000003 5 -> 3 504 remx853 remainder 100003 5 -> 3 505 remx854 remainder 10003 5 -> 3 506 remx855 remainder 1003 5 -> 3 507 remx856 remainder 103 5 -> 3 508 remx857 remainder 13 5 -> 3 509 remx858 remainder 1 5 -> 1 510 511 -- Vladimir's cases 512 remx860 remainder 123.0e1 10000000000000000 -> 1230 513 remx861 remainder 1230 10000000000000000 -> 1230 514 remx862 remainder 12.3e2 10000000000000000 -> 1230 515 remx863 remainder 1.23e3 10000000000000000 -> 1230 516 remx864 remainder 123e1 10000000000000000 -> 1230 517 remx870 remainder 123e1 1000000000000000 -> 1230 518 remx871 remainder 123e1 100000000000000 -> 1230 519 remx872 remainder 123e1 10000000000000 -> 1230 520 remx873 remainder 123e1 1000000000000 -> 1230 521 remx874 remainder 123e1 100000000000 -> 1230 522 remx875 remainder 123e1 10000000000 -> 1230 523 remx876 remainder 123e1 1000000000 -> 1230 524 remx877 remainder 123e1 100000000 -> 1230 525 remx878 remainder 1230 100000000 -> 1230 526 remx879 remainder 123e1 10000000 -> 1230 527 remx880 remainder 123e1 1000000 -> 1230 528 remx881 remainder 123e1 100000 -> 1230 529 remx882 remainder 123e1 10000 -> 1230 530 remx883 remainder 123e1 1000 -> 230 531 remx884 remainder 123e1 100 -> 30 532 remx885 remainder 123e1 10 -> 0 533 remx886 remainder 123e1 1 -> 0 534 535 remx889 remainder 123e1 20000000000000000 -> 1230 536 remx890 remainder 123e1 2000000000000000 -> 1230 537 remx891 remainder 123e1 200000000000000 -> 1230 538 remx892 remainder 123e1 20000000000000 -> 1230 539 remx893 remainder 123e1 2000000000000 -> 1230 540 remx894 remainder 123e1 200000000000 -> 1230 541 remx895 remainder 123e1 20000000000 -> 1230 542 remx896 remainder 123e1 2000000000 -> 1230 543 remx897 remainder 123e1 200000000 -> 1230 544 remx899 remainder 123e1 20000000 -> 1230 545 remx900 remainder 123e1 2000000 -> 1230 546 remx901 remainder 123e1 200000 -> 1230 547 remx902 remainder 123e1 20000 -> 1230 548 remx903 remainder 123e1 2000 -> 1230 549 remx904 remainder 123e1 200 -> 30 550 remx905 remainder 123e1 20 -> 10 551 remx906 remainder 123e1 2 -> 0 552 553 remx909 remainder 123e1 50000000000000000 -> 1230 554 remx910 remainder 123e1 5000000000000000 -> 1230 555 remx911 remainder 123e1 500000000000000 -> 1230 556 remx912 remainder 123e1 50000000000000 -> 1230 557 remx913 remainder 123e1 5000000000000 -> 1230 558 remx914 remainder 123e1 500000000000 -> 1230 559 remx915 remainder 123e1 50000000000 -> 1230 560 remx916 remainder 123e1 5000000000 -> 1230 561 remx917 remainder 123e1 500000000 -> 1230 562 remx919 remainder 123e1 50000000 -> 1230 563 remx920 remainder 123e1 5000000 -> 1230 564 remx921 remainder 123e1 500000 -> 1230 565 remx922 remainder 123e1 50000 -> 1230 566 remx923 remainder 123e1 5000 -> 1230 567 remx924 remainder 123e1 500 -> 230 568 remx925 remainder 123e1 50 -> 30 569 remx926 remainder 123e1 5 -> 0 570 571 remx929 remainder 123e1 90000000000000000 -> 1230 572 remx930 remainder 123e1 9000000000000000 -> 1230 573 remx931 remainder 123e1 900000000000000 -> 1230 574 remx932 remainder 123e1 90000000000000 -> 1230 575 remx933 remainder 123e1 9000000000000 -> 1230 576 remx934 remainder 123e1 900000000000 -> 1230 577 remx935 remainder 123e1 90000000000 -> 1230 578 remx936 remainder 123e1 9000000000 -> 1230 579 remx937 remainder 123e1 900000000 -> 1230 580 remx939 remainder 123e1 90000000 -> 1230 581 remx940 remainder 123e1 9000000 -> 1230 582 remx941 remainder 123e1 900000 -> 1230 583 remx942 remainder 123e1 90000 -> 1230 584 remx943 remainder 123e1 9000 -> 1230 585 remx944 remainder 123e1 900 -> 330 586 remx945 remainder 123e1 90 -> 60 587 remx946 remainder 123e1 9 -> 6 588 589 remx950 remainder 123e1 10000000000000000 -> 1230 590 remx951 remainder 123e1 100000000000000000 -> 1230 591 remx952 remainder 123e1 1000000000000000000 -> 1230 592 remx953 remainder 123e1 10000000000000000000 -> 1230 593 remx954 remainder 123e1 100000000000000000000 -> 1230 594 remx955 remainder 123e1 1000000000000000000000 -> 1230 595 remx956 remainder 123e1 10000000000000000000000 -> 1230 596 remx957 remainder 123e1 100000000000000000000000 -> 1230 597 remx958 remainder 123e1 1000000000000000000000000 -> 1230 598 remx959 remainder 123e1 10000000000000000000000000 -> 1230 599 600 remx960 remainder 123e1 19999999999999999 -> 1230 601 remx961 remainder 123e1 199999999999999990 -> 1230 602 remx962 remainder 123e1 1999999999999999999 -> 1230 603 remx963 remainder 123e1 19999999999999999990 -> 1230 604 remx964 remainder 123e1 199999999999999999999 -> 1230 605 remx965 remainder 123e1 1999999999999999999990 -> 1230 606 remx966 remainder 123e1 19999999999999999999999 -> 1230 607 remx967 remainder 123e1 199999999999999999999990 -> 1230 608 remx968 remainder 123e1 1999999999999999999999999 -> 1230 609 remx969 remainder 123e1 19999999999999999999999990 -> 1230 610 611 remx970 remainder 1e1 10000000000000000 -> 10 612 remx971 remainder 1e1 100000000000000000 -> 10 613 remx972 remainder 1e1 1000000000000000000 -> 10 614 remx973 remainder 1e1 10000000000000000000 -> 10 615 remx974 remainder 1e1 100000000000000000000 -> 10 616 remx975 remainder 1e1 1000000000000000000000 -> 10 617 remx976 remainder 1e1 10000000000000000000000 -> 10 618 remx977 remainder 1e1 100000000000000000000000 -> 10 619 remx978 remainder 1e1 1000000000000000000000000 -> 10 620 remx979 remainder 1e1 10000000000000000000000000 -> 10 621 622 remx980 remainder 123e1 1000E999999 -> 1.23E+3 -- 123E+1 internally 623 624 -- overflow and underflow tests [from divide] 625 precision: 9 626 maxexponent: 999999999 627 minexponent: -999999999 628 remx990 remainder +1.23456789012345E-0 9E+999999999 -> 1.23456789 Inexact Rounded 629 remx991 remainder 9E+999999999 +0.23456789012345E-0 -> NaN Division_impossible 630 remx992 remainder +0.100 9E+999999999 -> 0.100 631 remx993 remainder 9E-999999999 +9.100 -> 9E-999999999 632 remx995 remainder -1.23456789012345E-0 9E+999999999 -> -1.23456789 Inexact Rounded 633 remx996 remainder 9E+999999999 -0.83456789012345E-0 -> NaN Division_impossible 634 remx997 remainder -0.100 9E+999999999 -> -0.100 635 remx998 remainder 9E-999999999 -9.100 -> 9E-999999999 636 637 -- Null tests 638 remx1000 remainder 10 # -> NaN Invalid_operation 639 remx1001 remainder # 10 -> NaN Invalid_operation 640 641