Repository URL to install this package:
------------------------------------------------------------------------ -- dqCompare.decTest -- decQuad comparison that allows quiet NaNs -- -- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- ------------------------------------------------------------------------ -- Please see the document "General Decimal Arithmetic Testcases" -- -- at http://www2.hursley.ibm.com/decimal for the description of -- -- these testcases. -- -- -- -- These testcases are experimental ('beta' versions), and they -- -- may contain errors. They are offered on an as-is basis. In -- -- particular, achieving the same results as the tests here is not -- -- a guarantee that an implementation complies with any Standard -- -- or specification. The tests are not exhaustive. -- -- -- -- Please send comments, suggestions, and corrections to the author: -- -- Mike Cowlishaw, IBM Fellow -- -- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ version: 2.59 -- Note that we cannot assume add/subtract tests cover paths adequately, -- here, because the code might be quite different (comparison cannot -- overflow or underflow, so actual subtractions are not necessary). -- All operands and results are decQuads. extended: 1 clamp: 1 precision: 34 maxExponent: 6144 minExponent: -6143 rounding: half_even -- sanity checks dqcom001 compare -2 -2 -> 0 dqcom002 compare -2 -1 -> -1 dqcom003 compare -2 0 -> -1 dqcom004 compare -2 1 -> -1 dqcom005 compare -2 2 -> -1 dqcom006 compare -1 -2 -> 1 dqcom007 compare -1 -1 -> 0 dqcom008 compare -1 0 -> -1 dqcom009 compare -1 1 -> -1 dqcom010 compare -1 2 -> -1 dqcom011 compare 0 -2 -> 1 dqcom012 compare 0 -1 -> 1 dqcom013 compare 0 0 -> 0 dqcom014 compare 0 1 -> -1 dqcom015 compare 0 2 -> -1 dqcom016 compare 1 -2 -> 1 dqcom017 compare 1 -1 -> 1 dqcom018 compare 1 0 -> 1 dqcom019 compare 1 1 -> 0 dqcom020 compare 1 2 -> -1 dqcom021 compare 2 -2 -> 1 dqcom022 compare 2 -1 -> 1 dqcom023 compare 2 0 -> 1 dqcom025 compare 2 1 -> 1 dqcom026 compare 2 2 -> 0 dqcom031 compare -20 -20 -> 0 dqcom032 compare -20 -10 -> -1 dqcom033 compare -20 00 -> -1 dqcom034 compare -20 10 -> -1 dqcom035 compare -20 20 -> -1 dqcom036 compare -10 -20 -> 1 dqcom037 compare -10 -10 -> 0 dqcom038 compare -10 00 -> -1 dqcom039 compare -10 10 -> -1 dqcom040 compare -10 20 -> -1 dqcom041 compare 00 -20 -> 1 dqcom042 compare 00 -10 -> 1 dqcom043 compare 00 00 -> 0 dqcom044 compare 00 10 -> -1 dqcom045 compare 00 20 -> -1 dqcom046 compare 10 -20 -> 1 dqcom047 compare 10 -10 -> 1 dqcom048 compare 10 00 -> 1 dqcom049 compare 10 10 -> 0 dqcom050 compare 10 20 -> -1 dqcom051 compare 20 -20 -> 1 dqcom052 compare 20 -10 -> 1 dqcom053 compare 20 00 -> 1 dqcom055 compare 20 10 -> 1 dqcom056 compare 20 20 -> 0 dqcom061 compare -2.0 -2.0 -> 0 dqcom062 compare -2.0 -1.0 -> -1 dqcom063 compare -2.0 0.0 -> -1 dqcom064 compare -2.0 1.0 -> -1 dqcom065 compare -2.0 2.0 -> -1 dqcom066 compare -1.0 -2.0 -> 1 dqcom067 compare -1.0 -1.0 -> 0 dqcom068 compare -1.0 0.0 -> -1 dqcom069 compare -1.0 1.0 -> -1 dqcom070 compare -1.0 2.0 -> -1 dqcom071 compare 0.0 -2.0 -> 1 dqcom072 compare 0.0 -1.0 -> 1 dqcom073 compare 0.0 0.0 -> 0 dqcom074 compare 0.0 1.0 -> -1 dqcom075 compare 0.0 2.0 -> -1 dqcom076 compare 1.0 -2.0 -> 1 dqcom077 compare 1.0 -1.0 -> 1 dqcom078 compare 1.0 0.0 -> 1 dqcom079 compare 1.0 1.0 -> 0 dqcom080 compare 1.0 2.0 -> -1 dqcom081 compare 2.0 -2.0 -> 1 dqcom082 compare 2.0 -1.0 -> 1 dqcom083 compare 2.0 0.0 -> 1 dqcom085 compare 2.0 1.0 -> 1 dqcom086 compare 2.0 2.0 -> 0 -- now some cases which might overflow if subtract were used dqcom090 compare 9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> 0 dqcom091 compare -9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> -1 dqcom092 compare 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 1 dqcom093 compare -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0 -- some differing length/exponent cases dqcom100 compare 7.0 7.0 -> 0 dqcom101 compare 7.0 7 -> 0 dqcom102 compare 7 7.0 -> 0 dqcom103 compare 7E+0 7.0 -> 0 dqcom104 compare 70E-1 7.0 -> 0 dqcom105 compare 0.7E+1 7 -> 0 dqcom106 compare 70E-1 7 -> 0 dqcom107 compare 7.0 7E+0 -> 0 dqcom108 compare 7.0 70E-1 -> 0 dqcom109 compare 7 0.7E+1 -> 0 dqcom110 compare 7 70E-1 -> 0 dqcom120 compare 8.0 7.0 -> 1 dqcom121 compare 8.0 7 -> 1 dqcom122 compare 8 7.0 -> 1 dqcom123 compare 8E+0 7.0 -> 1 dqcom124 compare 80E-1 7.0 -> 1 dqcom125 compare 0.8E+1 7 -> 1 dqcom126 compare 80E-1 7 -> 1 dqcom127 compare 8.0 7E+0 -> 1 dqcom128 compare 8.0 70E-1 -> 1 dqcom129 compare 8 0.7E+1 -> 1 dqcom130 compare 8 70E-1 -> 1 dqcom140 compare 8.0 9.0 -> -1 dqcom141 compare 8.0 9 -> -1 dqcom142 compare 8 9.0 -> -1 dqcom143 compare 8E+0 9.0 -> -1 dqcom144 compare 80E-1 9.0 -> -1 dqcom145 compare 0.8E+1 9 -> -1 dqcom146 compare 80E-1 9 -> -1 dqcom147 compare 8.0 9E+0 -> -1 dqcom148 compare 8.0 90E-1 -> -1 dqcom149 compare 8 0.9E+1 -> -1 dqcom150 compare 8 90E-1 -> -1 -- and again, with sign changes -+ .. dqcom200 compare -7.0 7.0 -> -1 dqcom201 compare -7.0 7 -> -1 dqcom202 compare -7 7.0 -> -1 dqcom203 compare -7E+0 7.0 -> -1 dqcom204 compare -70E-1 7.0 -> -1 dqcom205 compare -0.7E+1 7 -> -1 dqcom206 compare -70E-1 7 -> -1 dqcom207 compare -7.0 7E+0 -> -1 dqcom208 compare -7.0 70E-1 -> -1 dqcom209 compare -7 0.7E+1 -> -1 dqcom210 compare -7 70E-1 -> -1 dqcom220 compare -8.0 7.0 -> -1 dqcom221 compare -8.0 7 -> -1 dqcom222 compare -8 7.0 -> -1 dqcom223 compare -8E+0 7.0 -> -1 dqcom224 compare -80E-1 7.0 -> -1 dqcom225 compare -0.8E+1 7 -> -1 dqcom226 compare -80E-1 7 -> -1 dqcom227 compare -8.0 7E+0 -> -1 dqcom228 compare -8.0 70E-1 -> -1 dqcom229 compare -8 0.7E+1 -> -1 dqcom230 compare -8 70E-1 -> -1 dqcom240 compare -8.0 9.0 -> -1 dqcom241 compare -8.0 9 -> -1 dqcom242 compare -8 9.0 -> -1 dqcom243 compare -8E+0 9.0 -> -1 dqcom244 compare -80E-1 9.0 -> -1 dqcom245 compare -0.8E+1 9 -> -1 dqcom246 compare -80E-1 9 -> -1 dqcom247 compare -8.0 9E+0 -> -1 dqcom248 compare -8.0 90E-1 -> -1 dqcom249 compare -8 0.9E+1 -> -1 dqcom250 compare -8 90E-1 -> -1 -- and again, with sign changes +- .. dqcom300 compare 7.0 -7.0 -> 1 dqcom301 compare 7.0 -7 -> 1 dqcom302 compare 7 -7.0 -> 1 dqcom303 compare 7E+0 -7.0 -> 1 dqcom304 compare 70E-1 -7.0 -> 1 dqcom305 compare .7E+1 -7 -> 1 dqcom306 compare 70E-1 -7 -> 1 dqcom307 compare 7.0 -7E+0 -> 1 dqcom308 compare 7.0 -70E-1 -> 1 dqcom309 compare 7 -.7E+1 -> 1 dqcom310 compare 7 -70E-1 -> 1 dqcom320 compare 8.0 -7.0 -> 1 dqcom321 compare 8.0 -7 -> 1 dqcom322 compare 8 -7.0 -> 1 dqcom323 compare 8E+0 -7.0 -> 1 dqcom324 compare 80E-1 -7.0 -> 1 dqcom325 compare .8E+1 -7 -> 1 dqcom326 compare 80E-1 -7 -> 1 dqcom327 compare 8.0 -7E+0 -> 1 dqcom328 compare 8.0 -70E-1 -> 1 dqcom329 compare 8 -.7E+1 -> 1 dqcom330 compare 8 -70E-1 -> 1 dqcom340 compare 8.0 -9.0 -> 1 dqcom341 compare 8.0 -9 -> 1 dqcom342 compare 8 -9.0 -> 1 dqcom343 compare 8E+0 -9.0 -> 1 dqcom344 compare 80E-1 -9.0 -> 1 dqcom345 compare .8E+1 -9 -> 1 dqcom346 compare 80E-1 -9 -> 1 dqcom347 compare 8.0 -9E+0 -> 1 dqcom348 compare 8.0 -90E-1 -> 1 dqcom349 compare 8 -.9E+1 -> 1 dqcom350 compare 8 -90E-1 -> 1 -- and again, with sign changes -- .. dqcom400 compare -7.0 -7.0 -> 0 dqcom401 compare -7.0 -7 -> 0 dqcom402 compare -7 -7.0 -> 0 dqcom403 compare -7E+0 -7.0 -> 0 dqcom404 compare -70E-1 -7.0 -> 0 dqcom405 compare -.7E+1 -7 -> 0 dqcom406 compare -70E-1 -7 -> 0 dqcom407 compare -7.0 -7E+0 -> 0 dqcom408 compare -7.0 -70E-1 -> 0 dqcom409 compare -7 -.7E+1 -> 0 dqcom410 compare -7 -70E-1 -> 0 dqcom420 compare -8.0 -7.0 -> -1 dqcom421 compare -8.0 -7 -> -1 dqcom422 compare -8 -7.0 -> -1 dqcom423 compare -8E+0 -7.0 -> -1 dqcom424 compare -80E-1 -7.0 -> -1 dqcom425 compare -.8E+1 -7 -> -1 dqcom426 compare -80E-1 -7 -> -1 dqcom427 compare -8.0 -7E+0 -> -1 dqcom428 compare -8.0 -70E-1 -> -1 dqcom429 compare -8 -.7E+1 -> -1 dqcom430 compare -8 -70E-1 -> -1 dqcom440 compare -8.0 -9.0 -> 1 dqcom441 compare -8.0 -9 -> 1 dqcom442 compare -8 -9.0 -> 1 dqcom443 compare -8E+0 -9.0 -> 1 dqcom444 compare -80E-1 -9.0 -> 1 dqcom445 compare -.8E+1 -9 -> 1 dqcom446 compare -80E-1 -9 -> 1 dqcom447 compare -8.0 -9E+0 -> 1 dqcom448 compare -8.0 -90E-1 -> 1 dqcom449 compare -8 -.9E+1 -> 1 dqcom450 compare -8 -90E-1 -> 1 -- misalignment traps for little-endian dqcom451 compare 1.0 0.1 -> 1 dqcom452 compare 0.1 1.0 -> -1 dqcom453 compare 10.0 0.1 -> 1 dqcom454 compare 0.1 10.0 -> -1 dqcom455 compare 100 1.0 -> 1 dqcom456 compare 1.0 100 -> -1 dqcom457 compare 1000 10.0 -> 1 dqcom458 compare 10.0 1000 -> -1 dqcom459 compare 10000 100.0 -> 1 dqcom460 compare 100.0 10000 -> -1 dqcom461 compare 100000 1000.0 -> 1 dqcom462 compare 1000.0 100000 -> -1 dqcom463 compare 1000000 10000.0 -> 1 dqcom464 compare 10000.0 1000000 -> -1 -- testcases that subtract to lots of zeros at boundaries [pgr] dqcom473 compare 123.9999999999999999994560000000000E-89 123.999999999999999999456E-89 -> 0 dqcom474 compare 123.999999999999999999456000000000E+89 123.999999999999999999456E+89 -> 0 dqcom475 compare 123.99999999999999999945600000000E-89 123.999999999999999999456E-89 -> 0 dqcom476 compare 123.9999999999999999994560000000E+89 123.999999999999999999456E+89 -> 0 dqcom477 compare 123.999999999999999999456000000E-89 123.999999999999999999456E-89 -> 0 dqcom478 compare 123.99999999999999999945600000E+89 123.999999999999999999456E+89 -> 0 dqcom479 compare 123.9999999999999999994560000E-89 123.999999999999999999456E-89 -> 0 dqcom480 compare 123.999999999999999999456000E+89 123.999999999999999999456E+89 -> 0 dqcom481 compare 123.99999999999999999945600E-89 123.999999999999999999456E-89 -> 0 dqcom482 compare 123.9999999999999999994560E+89 123.999999999999999999456E+89 -> 0 dqcom483 compare 123.999999999999999999456E-89 123.999999999999999999456E-89 -> 0 dqcom487 compare 123.999999999999999999456E+89 123.9999999999999999994560000000000E+89 -> 0 dqcom488 compare 123.999999999999999999456E-89 123.999999999999999999456000000000E-89 -> 0 dqcom489 compare 123.999999999999999999456E+89 123.99999999999999999945600000000E+89 -> 0 dqcom490 compare 123.999999999999999999456E-89 123.9999999999999999994560000000E-89 -> 0 dqcom491 compare 123.999999999999999999456E+89 123.999999999999999999456000000E+89 -> 0 dqcom492 compare 123.999999999999999999456E-89 123.99999999999999999945600000E-89 -> 0 dqcom493 compare 123.999999999999999999456E+89 123.9999999999999999994560000E+89 -> 0 dqcom494 compare 123.999999999999999999456E-89 123.999999999999999999456000E-89 -> 0 dqcom495 compare 123.999999999999999999456E+89 123.99999999999999999945600E+89 -> 0 dqcom496 compare 123.999999999999999999456E-89 123.9999999999999999994560E-89 -> 0 dqcom497 compare 123.999999999999999999456E+89 123.999999999999999999456E+89 -> 0 -- wide-ranging, around precision; signs equal dqcom500 compare 1 1E-15 -> 1 dqcom501 compare 1 1E-14 -> 1 dqcom502 compare 1 1E-13 -> 1 dqcom503 compare 1 1E-12 -> 1 dqcom504 compare 1 1E-11 -> 1 dqcom505 compare 1 1E-10 -> 1 dqcom506 compare 1 1E-9 -> 1 dqcom507 compare 1 1E-8 -> 1 dqcom508 compare 1 1E-7 -> 1 dqcom509 compare 1 1E-6 -> 1 dqcom510 compare 1 1E-5 -> 1 dqcom511 compare 1 1E-4 -> 1 dqcom512 compare 1 1E-3 -> 1 dqcom513 compare 1 1E-2 -> 1 dqcom514 compare 1 1E-1 -> 1 dqcom515 compare 1 1E-0 -> 0 dqcom516 compare 1 1E+1 -> -1 dqcom517 compare 1 1E+2 -> -1 dqcom518 compare 1 1E+3 -> -1 dqcom519 compare 1 1E+4 -> -1 dqcom521 compare 1 1E+5 -> -1 dqcom522 compare 1 1E+6 -> -1 dqcom523 compare 1 1E+7 -> -1 dqcom524 compare 1 1E+8 -> -1 dqcom525 compare 1 1E+9 -> -1 dqcom526 compare 1 1E+10 -> -1 dqcom527 compare 1 1E+11 -> -1 dqcom528 compare 1 1E+12 -> -1 dqcom529 compare 1 1E+13 -> -1 dqcom530 compare 1 1E+14 -> -1 dqcom531 compare 1 1E+15 -> -1 -- LR swap dqcom540 compare 1E-15 1 -> -1 dqcom541 compare 1E-14 1 -> -1 dqcom542 compare 1E-13 1 -> -1 dqcom543 compare 1E-12 1 -> -1 dqcom544 compare 1E-11 1 -> -1 dqcom545 compare 1E-10 1 -> -1Loading ...