1 ------------------------------------------------------------------------ 2 -- ddRemainder.decTest -- decDouble 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 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 ddrem001 remainder 1 1 -> 0 31 ddrem002 remainder 2 1 -> 0 32 ddrem003 remainder 1 2 -> 1 33 ddrem004 remainder 2 2 -> 0 34 ddrem005 remainder 0 1 -> 0 35 ddrem006 remainder 0 2 -> 0 36 ddrem007 remainder 1 3 -> 1 37 ddrem008 remainder 2 3 -> 2 38 ddrem009 remainder 3 3 -> 0 39 40 ddrem010 remainder 2.4 1 -> 0.4 41 ddrem011 remainder 2.4 -1 -> 0.4 42 ddrem012 remainder -2.4 1 -> -0.4 43 ddrem013 remainder -2.4 -1 -> -0.4 44 ddrem014 remainder 2.40 1 -> 0.40 45 ddrem015 remainder 2.400 1 -> 0.400 46 ddrem016 remainder 2.4 2 -> 0.4 47 ddrem017 remainder 2.400 2 -> 0.400 48 ddrem018 remainder 2. 2 -> 0 49 ddrem019 remainder 20 20 -> 0 50 51 ddrem020 remainder 187 187 -> 0 52 ddrem021 remainder 5 2 -> 1 53 ddrem022 remainder 5 2.0 -> 1.0 54 ddrem023 remainder 5 2.000 -> 1.000 55 ddrem024 remainder 5 0.200 -> 0.000 56 ddrem025 remainder 5 0.200 -> 0.000 57 58 ddrem030 remainder 1 2 -> 1 59 ddrem031 remainder 1 4 -> 1 60 ddrem032 remainder 1 8 -> 1 61 62 ddrem033 remainder 1 16 -> 1 63 ddrem034 remainder 1 32 -> 1 64 ddrem035 remainder 1 64 -> 1 65 ddrem040 remainder 1 -2 -> 1 66 ddrem041 remainder 1 -4 -> 1 67 ddrem042 remainder 1 -8 -> 1 68 ddrem043 remainder 1 -16 -> 1 69 ddrem044 remainder 1 -32 -> 1 70 ddrem045 remainder 1 -64 -> 1 71 ddrem050 remainder -1 2 -> -1 72 ddrem051 remainder -1 4 -> -1 73 ddrem052 remainder -1 8 -> -1 74 ddrem053 remainder -1 16 -> -1 75 ddrem054 remainder -1 32 -> -1 76 ddrem055 remainder -1 64 -> -1 77 ddrem060 remainder -1 -2 -> -1 78 ddrem061 remainder -1 -4 -> -1 79 ddrem062 remainder -1 -8 -> -1 80 ddrem063 remainder -1 -16 -> -1 81 ddrem064 remainder -1 -32 -> -1 82 ddrem065 remainder -1 -64 -> -1 83 84 ddrem066 remainder 999999999 1 -> 0 85 ddrem067 remainder 999999999.4 1 -> 0.4 86 ddrem068 remainder 999999999.5 1 -> 0.5 87 ddrem069 remainder 999999999.9 1 -> 0.9 88 ddrem070 remainder 999999999.999 1 -> 0.999 89 ddrem071 remainder 999999.999999 1 -> 0.999999 90 ddrem072 remainder 9 1 -> 0 91 ddrem073 remainder 9999999999999999 1 -> 0 92 ddrem074 remainder 9999999999999999 2 -> 1 93 ddrem075 remainder 9999999999999999 3 -> 0 94 ddrem076 remainder 9999999999999999 4 -> 3 95 96 ddrem080 remainder 0. 1 -> 0 97 ddrem081 remainder .0 1 -> 0.0 98 ddrem082 remainder 0.00 1 -> 0.00 99 ddrem083 remainder 0.00E+9 1 -> 0 100 ddrem084 remainder 0.00E+3 1 -> 0 101 ddrem085 remainder 0.00E+2 1 -> 0 102 ddrem086 remainder 0.00E+1 1 -> 0.0 103 ddrem087 remainder 0.00E+0 1 -> 0.00 104 ddrem088 remainder 0.00E-0 1 -> 0.00 105 ddrem089 remainder 0.00E-1 1 -> 0.000 106 ddrem090 remainder 0.00E-2 1 -> 0.0000 107 ddrem091 remainder 0.00E-3 1 -> 0.00000 108 ddrem092 remainder 0.00E-4 1 -> 0.000000 109 ddrem093 remainder 0.00E-5 1 -> 0E-7 110 ddrem094 remainder 0.00E-6 1 -> 0E-8 111 ddrem095 remainder 0.0000E-50 1 -> 0E-54 112 113 -- Various flavours of remainder by 0 114 ddrem101 remainder 0 0 -> NaN Division_undefined 115 ddrem102 remainder 0 -0 -> NaN Division_undefined 116 ddrem103 remainder -0 0 -> NaN Division_undefined 117 ddrem104 remainder -0 -0 -> NaN Division_undefined 118 ddrem105 remainder 0.0E5 0 -> NaN Division_undefined 119 ddrem106 remainder 0.000 0 -> NaN Division_undefined 120 -- [Some think this next group should be Division_by_zero exception, but 121 -- IEEE 854 is explicit that it is Invalid operation .. for 122 -- remainder-near, anyway] 123 ddrem107 remainder 0.0001 0 -> NaN Invalid_operation 124 ddrem108 remainder 0.01 0 -> NaN Invalid_operation 125 ddrem109 remainder 0.1 0 -> NaN Invalid_operation 126 ddrem110 remainder 1 0 -> NaN Invalid_operation 127 ddrem111 remainder 1 0.0 -> NaN Invalid_operation 128 ddrem112 remainder 10 0.0 -> NaN Invalid_operation 129 ddrem113 remainder 1E+100 0.0 -> NaN Invalid_operation 130 ddrem114 remainder 1E+380 0 -> NaN Invalid_operation 131 ddrem115 remainder 0.0001 -0 -> NaN Invalid_operation 132 ddrem116 remainder 0.01 -0 -> NaN Invalid_operation 133 ddrem119 remainder 0.1 -0 -> NaN Invalid_operation 134 ddrem120 remainder 1 -0 -> NaN Invalid_operation 135 ddrem121 remainder 1 -0.0 -> NaN Invalid_operation 136 ddrem122 remainder 10 -0.0 -> NaN Invalid_operation 137 ddrem123 remainder 1E+100 -0.0 -> NaN Invalid_operation 138 ddrem124 remainder 1E+384 -0 -> NaN Invalid_operation 139 -- and zeros on left 140 ddrem130 remainder 0 1 -> 0 141 ddrem131 remainder 0 -1 -> 0 142 ddrem132 remainder 0.0 1 -> 0.0 143 ddrem133 remainder 0.0 -1 -> 0.0 144 ddrem134 remainder -0 1 -> -0 145 ddrem135 remainder -0 -1 -> -0 146 ddrem136 remainder -0.0 1 -> -0.0 147 ddrem137 remainder -0.0 -1 -> -0.0 148 149 -- 0.5ers 150 ddrem143 remainder 0.5 2 -> 0.5 151 ddrem144 remainder 0.5 2.1 -> 0.5 152 ddrem145 remainder 0.5 2.01 -> 0.50 153 ddrem146 remainder 0.5 2.001 -> 0.500 154 ddrem147 remainder 0.50 2 -> 0.50 155 ddrem148 remainder 0.50 2.01 -> 0.50 156 ddrem149 remainder 0.50 2.001 -> 0.500 157 158 -- steadies 159 ddrem150 remainder 1 1 -> 0 160 ddrem151 remainder 1 2 -> 1 161 ddrem152 remainder 1 3 -> 1 162 ddrem153 remainder 1 4 -> 1 163 ddrem154 remainder 1 5 -> 1 164 ddrem155 remainder 1 6 -> 1 165 ddrem156 remainder 1 7 -> 1 166 ddrem157 remainder 1 8 -> 1 167 ddrem158 remainder 1 9 -> 1 168 ddrem159 remainder 1 10 -> 1 169 ddrem160 remainder 1 1 -> 0 170 ddrem161 remainder 2 1 -> 0 171 ddrem162 remainder 3 1 -> 0 172 ddrem163 remainder 4 1 -> 0 173 ddrem164 remainder 5 1 -> 0 174 ddrem165 remainder 6 1 -> 0 175 ddrem166 remainder 7 1 -> 0 176 ddrem167 remainder 8 1 -> 0 177 ddrem168 remainder 9 1 -> 0 178 ddrem169 remainder 10 1 -> 0 179 180 -- some differences from remainderNear 181 ddrem171 remainder 0.4 1.020 -> 0.400 182 ddrem172 remainder 0.50 1.020 -> 0.500 183 ddrem173 remainder 0.51 1.020 -> 0.510 184 ddrem174 remainder 0.52 1.020 -> 0.520 185 ddrem175 remainder 0.6 1.020 -> 0.600 186 187 -- More flavours of remainder by 0 188 ddrem201 remainder 0 0 -> NaN Division_undefined 189 ddrem202 remainder 0.0E5 0 -> NaN Division_undefined 190 ddrem203 remainder 0.000 0 -> NaN Division_undefined 191 ddrem204 remainder 0.0001 0 -> NaN Invalid_operation 192 ddrem205 remainder 0.01 0 -> NaN Invalid_operation 193 ddrem206 remainder 0.1 0 -> NaN Invalid_operation 194 ddrem207 remainder 1 0 -> NaN Invalid_operation 195 ddrem208 remainder 1 0.0 -> NaN Invalid_operation 196 ddrem209 remainder 10 0.0 -> NaN Invalid_operation 197 ddrem210 remainder 1E+100 0.0 -> NaN Invalid_operation 198 ddrem211 remainder 1E+380 0 -> NaN Invalid_operation 199 200 -- some differences from remainderNear 201 ddrem231 remainder -0.4 1.020 -> -0.400 202 ddrem232 remainder -0.50 1.020 -> -0.500 203 ddrem233 remainder -0.51 1.020 -> -0.510 204 ddrem234 remainder -0.52 1.020 -> -0.520 205 ddrem235 remainder -0.6 1.020 -> -0.600 206 207 -- high Xs 208 ddrem240 remainder 1E+2 1.00 -> 0.00 209 210 -- ddrem3xx are from DiagBigDecimal 211 ddrem301 remainder 1 3 -> 1 212 ddrem302 remainder 5 5 -> 0 213 ddrem303 remainder 13 10 -> 3 214 ddrem304 remainder 13 50 -> 13 215 ddrem305 remainder 13 100 -> 13 216 ddrem306 remainder 13 1000 -> 13 217 ddrem307 remainder .13 1 -> 0.13 218 ddrem308 remainder 0.133 1 -> 0.133 219 ddrem309 remainder 0.1033 1 -> 0.1033 220 ddrem310 remainder 1.033 1 -> 0.033 221 ddrem311 remainder 10.33 1 -> 0.33 222 ddrem312 remainder 10.33 10 -> 0.33 223 ddrem313 remainder 103.3 1 -> 0.3 224 ddrem314 remainder 133 10 -> 3 225 ddrem315 remainder 1033 10 -> 3 226 ddrem316 remainder 1033 50 -> 33 227 ddrem317 remainder 101.0 3 -> 2.0 228 ddrem318 remainder 102.0 3 -> 0.0 229 ddrem319 remainder 103.0 3 -> 1.0 230 ddrem320 remainder 2.40 1 -> 0.40 231 ddrem321 remainder 2.400 1 -> 0.400 232 ddrem322 remainder 2.4 1 -> 0.4 233 ddrem323 remainder 2.4 2 -> 0.4 234 ddrem324 remainder 2.400 2 -> 0.400 235 ddrem325 remainder 1 0.3 -> 0.1 236 ddrem326 remainder 1 0.30 -> 0.10 237 ddrem327 remainder 1 0.300 -> 0.100 238 ddrem328 remainder 1 0.3000 -> 0.1000 239 ddrem329 remainder 1.0 0.3 -> 0.1 240 ddrem330 remainder 1.00 0.3 -> 0.10 241 ddrem331 remainder 1.000 0.3 -> 0.100 242 ddrem332 remainder 1.0000 0.3 -> 0.1000 243 ddrem333 remainder 0.5 2 -> 0.5 244 ddrem334 remainder 0.5 2.1 -> 0.5 245 ddrem335 remainder 0.5 2.01 -> 0.50 246 ddrem336 remainder 0.5 2.001 -> 0.500 247 ddrem337 remainder 0.50 2 -> 0.50 248 ddrem338 remainder 0.50 2.01 -> 0.50 249 ddrem339 remainder 0.50 2.001 -> 0.500 250 251 ddrem340 remainder 0.5 0.5000001 -> 0.5000000 252 ddrem341 remainder 0.5 0.50000001 -> 0.50000000 253 ddrem342 remainder 0.5 0.500000001 -> 0.500000000 254 ddrem343 remainder 0.5 0.5000000001 -> 0.5000000000 255 ddrem344 remainder 0.5 0.50000000001 -> 0.50000000000 256 ddrem345 remainder 0.5 0.4999999 -> 1E-7 257 ddrem346 remainder 0.5 0.49999999 -> 1E-8 258 ddrem347 remainder 0.5 0.499999999 -> 1E-9 259 ddrem348 remainder 0.5 0.4999999999 -> 1E-10 260 ddrem349 remainder 0.5 0.49999999999 -> 1E-11 261 ddrem350 remainder 0.5 0.499999999999 -> 1E-12 262 263 ddrem351 remainder 0.03 7 -> 0.03 264 ddrem352 remainder 5 2 -> 1 265 ddrem353 remainder 4.1 2 -> 0.1 266 ddrem354 remainder 4.01 2 -> 0.01 267 ddrem355 remainder 4.001 2 -> 0.001 268 ddrem356 remainder 4.0001 2 -> 0.0001 269 ddrem357 remainder 4.00001 2 -> 0.00001 270 ddrem358 remainder 4.000001 2 -> 0.000001 271 ddrem359 remainder 4.0000001 2 -> 1E-7 272 273 ddrem360 remainder 1.2 0.7345 -> 0.4655 274 ddrem361 remainder 0.8 12 -> 0.8 275 ddrem362 remainder 0.8 0.2 -> 0.0 276 ddrem363 remainder 0.8 0.3 -> 0.2 277 ddrem364 remainder 0.800 12 -> 0.800 278 ddrem365 remainder 0.800 1.7 -> 0.800 279 ddrem366 remainder 2.400 2 -> 0.400 280 281 ddrem371 remainder 2.400 2 -> 0.400 282 283 ddrem381 remainder 12345 1 -> 0 284 ddrem382 remainder 12345 1.0001 -> 0.7657 285 ddrem383 remainder 12345 1.001 -> 0.668 286 ddrem384 remainder 12345 1.01 -> 0.78 287 ddrem385 remainder 12345 1.1 -> 0.8 288 ddrem386 remainder 12355 4 -> 3 289 ddrem387 remainder 12345 4 -> 1 290 ddrem388 remainder 12355 4.0001 -> 2.6912 291 ddrem389 remainder 12345 4.0001 -> 0.6914 292 ddrem390 remainder 12345 4.9 -> 1.9 293 ddrem391 remainder 12345 4.99 -> 4.73 294 ddrem392 remainder 12345 4.999 -> 2.469 295 ddrem393 remainder 12345 4.9999 -> 0.2469 296 ddrem394 remainder 12345 5 -> 0 297 ddrem395 remainder 12345 5.0001 -> 4.7532 298 ddrem396 remainder 12345 5.001 -> 2.532 299 ddrem397 remainder 12345 5.01 -> 0.36 300 ddrem398 remainder 12345 5.1 -> 3.0 301 302 -- the nasty division-by-1 cases 303 ddrem401 remainder 0.5 1 -> 0.5 304 ddrem402 remainder 0.55 1 -> 0.55 305 ddrem403 remainder 0.555 1 -> 0.555 306 ddrem404 remainder 0.5555 1 -> 0.5555 307 ddrem405 remainder 0.55555 1 -> 0.55555 308 ddrem406 remainder 0.555555 1 -> 0.555555 309 ddrem407 remainder 0.5555555 1 -> 0.5555555 310 ddrem408 remainder 0.55555555 1 -> 0.55555555 311 ddrem409 remainder 0.555555555 1 -> 0.555555555 312 313 -- folddowns 314 ddrem421 remainder 1E+384 1 -> NaN Division_impossible 315 ddrem422 remainder 1E+384 1E+383 -> 0E+369 Clamped 316 ddrem423 remainder 1E+384 2E+383 -> 0E+369 Clamped 317 ddrem424 remainder 1E+384 3E+383 -> 1.00000000000000E+383 Clamped 318 ddrem425 remainder 1E+384 4E+383 -> 2.00000000000000E+383 Clamped 319 ddrem426 remainder 1E+384 5E+383 -> 0E+369 Clamped 320 ddrem427 remainder 1E+384 6E+383 -> 4.00000000000000E+383 Clamped 321 ddrem428 remainder 1E+384 7E+383 -> 3.00000000000000E+383 Clamped 322 ddrem429 remainder 1E+384 8E+383 -> 2.00000000000000E+383 Clamped 323 ddrem430 remainder 1E+384 9E+383 -> 1.00000000000000E+383 Clamped 324 -- tinies 325 ddrem431 remainder 1E-397 1E-398 -> 0E-398 326 ddrem432 remainder 1E-397 2E-398 -> 0E-398 327 ddrem433 remainder 1E-397 3E-398 -> 1E-398 Subnormal 328 ddrem434 remainder 1E-397 4E-398 -> 2E-398 Subnormal 329 ddrem435 remainder 1E-397 5E-398 -> 0E-398 330 ddrem436 remainder 1E-397 6E-398 -> 4E-398 Subnormal 331 ddrem437 remainder 1E-397 7E-398 -> 3E-398 Subnormal 332 ddrem438 remainder 1E-397 8E-398 -> 2E-398 Subnormal 333 ddrem439 remainder 1E-397 9E-398 -> 1E-398 Subnormal 334 ddrem440 remainder 1E-397 10E-398 -> 0E-398 335 ddrem441 remainder 1E-397 11E-398 -> 1.0E-397 Subnormal 336 ddrem442 remainder 100E-397 11E-398 -> 1.0E-397 Subnormal 337 ddrem443 remainder 100E-397 20E-398 -> 0E-398 338 ddrem444 remainder 100E-397 21E-398 -> 1.3E-397 Subnormal 339 ddrem445 remainder 100E-397 30E-398 -> 1.0E-397 Subnormal 340 341 -- zero signs 342 ddrem650 remainder 1 1 -> 0 343 ddrem651 remainder -1 1 -> -0 344 ddrem652 remainder 1 -1 -> 0 345 ddrem653 remainder -1 -1 -> -0 346 ddrem654 remainder 0 1 -> 0 347 ddrem655 remainder -0 1 -> -0 348 ddrem656 remainder 0 -1 -> 0 349 ddrem657 remainder -0 -1 -> -0 350 ddrem658 remainder 0.00 1 -> 0.00 351 ddrem659 remainder -0.00 1 -> -0.00 352 353 -- Specials 354 ddrem680 remainder Inf -Inf -> NaN Invalid_operation 355 ddrem681 remainder Inf -1000 -> NaN Invalid_operation 356 ddrem682 remainder Inf -1 -> NaN Invalid_operation 357 ddrem683 remainder Inf 0 -> NaN Invalid_operation 358 ddrem684 remainder Inf -0 -> NaN Invalid_operation 359 ddrem685 remainder Inf 1 -> NaN Invalid_operation 360 ddrem686 remainder Inf 1000 -> NaN Invalid_operation 361 ddrem687 remainder Inf Inf -> NaN Invalid_operation 362 ddrem688 remainder -1000 Inf -> -1000 363 ddrem689 remainder -Inf Inf -> NaN Invalid_operation 364 ddrem691 remainder -1 Inf -> -1 365 ddrem692 remainder 0 Inf -> 0 366 ddrem693 remainder -0 Inf -> -0 367 ddrem694 remainder 1 Inf -> 1 368 ddrem695 remainder 1000 Inf -> 1000 369 ddrem696 remainder Inf Inf -> NaN Invalid_operation 370 371 ddrem700 remainder -Inf -Inf -> NaN Invalid_operation 372 ddrem701 remainder -Inf -1000 -> NaN Invalid_operation 373 ddrem702 remainder -Inf -1 -> NaN Invalid_operation 374 ddrem703 remainder -Inf -0 -> NaN Invalid_operation 375 ddrem704 remainder -Inf 0 -> NaN Invalid_operation 376 ddrem705 remainder -Inf 1 -> NaN Invalid_operation 377 ddrem706 remainder -Inf 1000 -> NaN Invalid_operation 378 ddrem707 remainder -Inf Inf -> NaN Invalid_operation 379 ddrem708 remainder -Inf -Inf -> NaN Invalid_operation 380 ddrem709 remainder -1000 Inf -> -1000 381 ddrem710 remainder -1 -Inf -> -1 382 ddrem711 remainder -0 -Inf -> -0 383 ddrem712 remainder 0 -Inf -> 0 384 ddrem713 remainder 1 -Inf -> 1 385 ddrem714 remainder 1000 -Inf -> 1000 386 ddrem715 remainder Inf -Inf -> NaN Invalid_operation 387 388 ddrem721 remainder NaN -Inf -> NaN 389 ddrem722 remainder NaN -1000 -> NaN 390 ddrem723 remainder NaN -1 -> NaN 391 ddrem724 remainder NaN -0 -> NaN 392 ddrem725 remainder -NaN 0 -> -NaN 393 ddrem726 remainder NaN 1 -> NaN 394 ddrem727 remainder NaN 1000 -> NaN 395 ddrem728 remainder NaN Inf -> NaN 396 ddrem729 remainder NaN -NaN -> NaN 397 ddrem730 remainder -Inf NaN -> NaN 398 ddrem731 remainder -1000 NaN -> NaN 399 ddrem732 remainder -1 NaN -> NaN 400 ddrem733 remainder -0 -NaN -> -NaN 401 ddrem734 remainder 0 NaN -> NaN 402 ddrem735 remainder 1 -NaN -> -NaN 403 ddrem736 remainder 1000 NaN -> NaN 404 ddrem737 remainder Inf NaN -> NaN 405 406 ddrem741 remainder sNaN -Inf -> NaN Invalid_operation 407 ddrem742 remainder sNaN -1000 -> NaN Invalid_operation 408 ddrem743 remainder -sNaN -1 -> -NaN Invalid_operation 409 ddrem744 remainder sNaN -0 -> NaN Invalid_operation 410 ddrem745 remainder sNaN 0 -> NaN Invalid_operation 411 ddrem746 remainder sNaN 1 -> NaN Invalid_operation 412 ddrem747 remainder sNaN 1000 -> NaN Invalid_operation 413 ddrem749 remainder sNaN NaN -> NaN Invalid_operation 414 ddrem750 remainder sNaN sNaN -> NaN Invalid_operation 415 ddrem751 remainder NaN sNaN -> NaN Invalid_operation 416 ddrem752 remainder -Inf sNaN -> NaN Invalid_operation 417 ddrem753 remainder -1000 sNaN -> NaN Invalid_operation 418 ddrem754 remainder -1 sNaN -> NaN Invalid_operation 419 ddrem755 remainder -0 sNaN -> NaN Invalid_operation 420 ddrem756 remainder 0 sNaN -> NaN Invalid_operation 421 ddrem757 remainder 1 sNaN -> NaN Invalid_operation 422 ddrem758 remainder 1000 sNaN -> NaN Invalid_operation 423 ddrem759 remainder Inf -sNaN -> -NaN Invalid_operation 424 425 -- propaging NaNs 426 ddrem760 remainder NaN1 NaN7 -> NaN1 427 ddrem761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation 428 ddrem762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation 429 ddrem763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation 430 ddrem764 remainder 15 NaN11 -> NaN11 431 ddrem765 remainder NaN6 NaN12 -> NaN6 432 ddrem766 remainder Inf NaN13 -> NaN13 433 ddrem767 remainder NaN14 -Inf -> NaN14 434 ddrem768 remainder 0 NaN15 -> NaN15 435 ddrem769 remainder NaN16 -0 -> NaN16 436 437 -- edge cases of impossible 438 ddrem770 remainder 1234567890123456 10 -> 6 439 ddrem771 remainder 1234567890123456 1 -> 0 440 ddrem772 remainder 1234567890123456 0.1 -> NaN Division_impossible 441 ddrem773 remainder 1234567890123456 0.01 -> NaN Division_impossible 442 443 -- long operand checks 444 ddrem801 remainder 12345678000 100 -> 0 445 ddrem802 remainder 1 12345678000 -> 1 446 ddrem803 remainder 1234567800 10 -> 0 447 ddrem804 remainder 1 1234567800 -> 1 448 ddrem805 remainder 1234567890 10 -> 0 449 ddrem806 remainder 1 1234567890 -> 1 450 ddrem807 remainder 1234567891 10 -> 1 451 ddrem808 remainder 1 1234567891 -> 1 452 ddrem809 remainder 12345678901 100 -> 1 453 ddrem810 remainder 1 12345678901 -> 1 454 ddrem811 remainder 1234567896 10 -> 6 455 ddrem812 remainder 1 1234567896 -> 1 456 457 ddrem821 remainder 12345678000 100 -> 0 458 ddrem822 remainder 1 12345678000 -> 1 459 ddrem823 remainder 1234567800 10 -> 0 460 ddrem824 remainder 1 1234567800 -> 1 461 ddrem825 remainder 1234567890 10 -> 0 462 ddrem826 remainder 1 1234567890 -> 1 463 ddrem827 remainder 1234567891 10 -> 1 464 ddrem828 remainder 1 1234567891 -> 1 465 ddrem829 remainder 12345678901 100 -> 1 466 ddrem830 remainder 1 12345678901 -> 1 467 ddrem831 remainder 1234567896 10 -> 6 468 ddrem832 remainder 1 1234567896 -> 1 469 470 -- from divideint 471 ddrem840 remainder 100000000.0 1 -> 0.0 472 ddrem841 remainder 100000000.4 1 -> 0.4 473 ddrem842 remainder 100000000.5 1 -> 0.5 474 ddrem843 remainder 100000000.9 1 -> 0.9 475 ddrem844 remainder 100000000.999 1 -> 0.999 476 ddrem850 remainder 100000003 5 -> 3 477 ddrem851 remainder 10000003 5 -> 3 478 ddrem852 remainder 1000003 5 -> 3 479 ddrem853 remainder 100003 5 -> 3 480 ddrem854 remainder 10003 5 -> 3 481 ddrem855 remainder 1003 5 -> 3 482 ddrem856 remainder 103 5 -> 3 483 ddrem857 remainder 13 5 -> 3 484 ddrem858 remainder 1 5 -> 1 485 486 -- Vladimir's cases 1234567890123456 487 ddrem860 remainder 123.0e1 1000000000000000 -> 1230 488 ddrem861 remainder 1230 1000000000000000 -> 1230 489 ddrem862 remainder 12.3e2 1000000000000000 -> 1230 490 ddrem863 remainder 1.23e3 1000000000000000 -> 1230 491 ddrem864 remainder 123e1 1000000000000000 -> 1230 492 ddrem870 remainder 123e1 1000000000000000 -> 1230 493 ddrem871 remainder 123e1 100000000000000 -> 1230 494 ddrem872 remainder 123e1 10000000000000 -> 1230 495 ddrem873 remainder 123e1 1000000000000 -> 1230 496 ddrem874 remainder 123e1 100000000000 -> 1230 497 ddrem875 remainder 123e1 10000000000 -> 1230 498 ddrem876 remainder 123e1 1000000000 -> 1230 499 ddrem877 remainder 123e1 100000000 -> 1230 500 ddrem878 remainder 1230 100000000 -> 1230 501 ddrem879 remainder 123e1 10000000 -> 1230 502 ddrem880 remainder 123e1 1000000 -> 1230 503 ddrem881 remainder 123e1 100000 -> 1230 504 ddrem882 remainder 123e1 10000 -> 1230 505 ddrem883 remainder 123e1 1000 -> 230 506 ddrem884 remainder 123e1 100 -> 30 507 ddrem885 remainder 123e1 10 -> 0 508 ddrem886 remainder 123e1 1 -> 0 509 510 ddrem890 remainder 123e1 2000000000000000 -> 1230 511 ddrem891 remainder 123e1 200000000000000 -> 1230 512 ddrem892 remainder 123e1 20000000000000 -> 1230 513 ddrem893 remainder 123e1 2000000000000 -> 1230 514 ddrem894 remainder 123e1 200000000000 -> 1230 515 ddrem895 remainder 123e1 20000000000 -> 1230 516 ddrem896 remainder 123e1 2000000000 -> 1230 517 ddrem897 remainder 123e1 200000000 -> 1230 518 ddrem899 remainder 123e1 20000000 -> 1230 519 ddrem900 remainder 123e1 2000000 -> 1230 520 ddrem901 remainder 123e1 200000 -> 1230 521 ddrem902 remainder 123e1 20000 -> 1230 522 ddrem903 remainder 123e1 2000 -> 1230 523 ddrem904 remainder 123e1 200 -> 30 524 ddrem905 remainder 123e1 20 -> 10 525 ddrem906 remainder 123e1 2 -> 0 526 527 ddrem910 remainder 123e1 5000000000000000 -> 1230 528 ddrem911 remainder 123e1 500000000000000 -> 1230 529 ddrem912 remainder 123e1 50000000000000 -> 1230 530 ddrem913 remainder 123e1 5000000000000 -> 1230 531 ddrem914 remainder 123e1 500000000000 -> 1230 532 ddrem915 remainder 123e1 50000000000 -> 1230 533 ddrem916 remainder 123e1 5000000000 -> 1230 534 ddrem917 remainder 123e1 500000000 -> 1230 535 ddrem919 remainder 123e1 50000000 -> 1230 536 ddrem920 remainder 123e1 5000000 -> 1230 537 ddrem921 remainder 123e1 500000 -> 1230 538 ddrem922 remainder 123e1 50000 -> 1230 539 ddrem923 remainder 123e1 5000 -> 1230 540 ddrem924 remainder 123e1 500 -> 230 541 ddrem925 remainder 123e1 50 -> 30 542 ddrem926 remainder 123e1 5 -> 0 543 544 ddrem930 remainder 123e1 9000000000000000 -> 1230 545 ddrem931 remainder 123e1 900000000000000 -> 1230 546 ddrem932 remainder 123e1 90000000000000 -> 1230 547 ddrem933 remainder 123e1 9000000000000 -> 1230 548 ddrem934 remainder 123e1 900000000000 -> 1230 549 ddrem935 remainder 123e1 90000000000 -> 1230 550 ddrem936 remainder 123e1 9000000000 -> 1230 551 ddrem937 remainder 123e1 900000000 -> 1230 552 ddrem939 remainder 123e1 90000000 -> 1230 553 ddrem940 remainder 123e1 9000000 -> 1230 554 ddrem941 remainder 123e1 900000 -> 1230 555 ddrem942 remainder 123e1 90000 -> 1230 556 ddrem943 remainder 123e1 9000 -> 1230 557 ddrem944 remainder 123e1 900 -> 330 558 ddrem945 remainder 123e1 90 -> 60 559 ddrem946 remainder 123e1 9 -> 6 560 561 ddrem950 remainder 123e1 1000000000000000 -> 1230 562 ddrem961 remainder 123e1 2999999999999999 -> 1230 563 ddrem962 remainder 123e1 3999999999999999 -> 1230 564 ddrem963 remainder 123e1 4999999999999999 -> 1230 565 ddrem964 remainder 123e1 5999999999999999 -> 1230 566 ddrem965 remainder 123e1 6999999999999999 -> 1230 567 ddrem966 remainder 123e1 7999999999999999 -> 1230 568 ddrem967 remainder 123e1 8999999999999999 -> 1230 569 ddrem968 remainder 123e1 9999999999999999 -> 1230 570 ddrem969 remainder 123e1 9876543210987654 -> 1230 571 572 ddrem980 remainder 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally 573 574 -- overflow and underflow tests [from divide] 575 ddrem1051 remainder 1e+277 1e-311 -> NaN Division_impossible 576 ddrem1052 remainder 1e+277 -1e-311 -> NaN Division_impossible 577 ddrem1053 remainder -1e+277 1e-311 -> NaN Division_impossible 578 ddrem1054 remainder -1e+277 -1e-311 -> NaN Division_impossible 579 ddrem1055 remainder 1e-277 1e+311 -> 1E-277 580 ddrem1056 remainder 1e-277 -1e+311 -> 1E-277 581 ddrem1057 remainder -1e-277 1e+311 -> -1E-277 582 ddrem1058 remainder -1e-277 -1e+311 -> -1E-277 583 584 -- destructive subtract 585 ddrem1101 remainder 1234567890123456 1.000000000000001 -> 0.765432109876546 586 ddrem1102 remainder 1234567890123456 1.00000000000001 -> 0.65432109876557 587 ddrem1103 remainder 1234567890123456 1.0000000000001 -> 0.5432109876668 588 ddrem1104 remainder 1234567890123455 4.000000000000001 -> 2.691358027469137 589 ddrem1105 remainder 1234567890123456 4.000000000000001 -> 3.691358027469137 590 ddrem1106 remainder 1234567890123456 4.9999999999999 -> 0.6913578024696 591 ddrem1107 remainder 1234567890123456 4.99999999999999 -> 3.46913578024691 592 ddrem1108 remainder 1234567890123456 4.999999999999999 -> 1.246913578024691 593 ddrem1109 remainder 1234567890123456 5.000000000000001 -> 0.753086421975309 594 ddrem1110 remainder 1234567890123456 5.00000000000001 -> 3.53086421975310 595 ddrem1111 remainder 1234567890123456 5.0000000000001 -> 1.3086421975314 596 597 -- Null tests 598 ddrem1000 remainder 10 # -> NaN Invalid_operation 599 ddrem1001 remainder # 10 -> NaN Invalid_operation 600 601