Repository URL to install this package:
------------------------------------------------------------------------
-- dqCompareTotalMag.decTest -- decQuad comparison; abs. total order --
-- 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).
-- Similarly, comparetotal will have some radically different paths
-- than compare.
-- All operands and results are decQuads.
extended: 1
clamp: 1
precision: 34
maxExponent: 6144
minExponent: -6143
rounding: half_even
-- sanity checks
dqctm001 comparetotmag -2 -2 -> 0
dqctm002 comparetotmag -2 -1 -> 1
dqctm003 comparetotmag -2 0 -> 1
dqctm004 comparetotmag -2 1 -> 1
dqctm005 comparetotmag -2 2 -> 0
dqctm006 comparetotmag -1 -2 -> -1
dqctm007 comparetotmag -1 -1 -> 0
dqctm008 comparetotmag -1 0 -> 1
dqctm009 comparetotmag -1 1 -> 0
dqctm010 comparetotmag -1 2 -> -1
dqctm011 comparetotmag 0 -2 -> -1
dqctm012 comparetotmag 0 -1 -> -1
dqctm013 comparetotmag 0 0 -> 0
dqctm014 comparetotmag 0 1 -> -1
dqctm015 comparetotmag 0 2 -> -1
dqctm016 comparetotmag 1 -2 -> -1
dqctm017 comparetotmag 1 -1 -> 0
dqctm018 comparetotmag 1 0 -> 1
dqctm019 comparetotmag 1 1 -> 0
dqctm020 comparetotmag 1 2 -> -1
dqctm021 comparetotmag 2 -2 -> 0
dqctm022 comparetotmag 2 -1 -> 1
dqctm023 comparetotmag 2 0 -> 1
dqctm025 comparetotmag 2 1 -> 1
dqctm026 comparetotmag 2 2 -> 0
dqctm031 comparetotmag -20 -20 -> 0
dqctm032 comparetotmag -20 -10 -> 1
dqctm033 comparetotmag -20 00 -> 1
dqctm034 comparetotmag -20 10 -> 1
dqctm035 comparetotmag -20 20 -> 0
dqctm036 comparetotmag -10 -20 -> -1
dqctm037 comparetotmag -10 -10 -> 0
dqctm038 comparetotmag -10 00 -> 1
dqctm039 comparetotmag -10 10 -> 0
dqctm040 comparetotmag -10 20 -> -1
dqctm041 comparetotmag 00 -20 -> -1
dqctm042 comparetotmag 00 -10 -> -1
dqctm043 comparetotmag 00 00 -> 0
dqctm044 comparetotmag 00 10 -> -1
dqctm045 comparetotmag 00 20 -> -1
dqctm046 comparetotmag 10 -20 -> -1
dqctm047 comparetotmag 10 -10 -> 0
dqctm048 comparetotmag 10 00 -> 1
dqctm049 comparetotmag 10 10 -> 0
dqctm050 comparetotmag 10 20 -> -1
dqctm051 comparetotmag 20 -20 -> 0
dqctm052 comparetotmag 20 -10 -> 1
dqctm053 comparetotmag 20 00 -> 1
dqctm055 comparetotmag 20 10 -> 1
dqctm056 comparetotmag 20 20 -> 0
dqctm061 comparetotmag -2.0 -2.0 -> 0
dqctm062 comparetotmag -2.0 -1.0 -> 1
dqctm063 comparetotmag -2.0 0.0 -> 1
dqctm064 comparetotmag -2.0 1.0 -> 1
dqctm065 comparetotmag -2.0 2.0 -> 0
dqctm066 comparetotmag -1.0 -2.0 -> -1
dqctm067 comparetotmag -1.0 -1.0 -> 0
dqctm068 comparetotmag -1.0 0.0 -> 1
dqctm069 comparetotmag -1.0 1.0 -> 0
dqctm070 comparetotmag -1.0 2.0 -> -1
dqctm071 comparetotmag 0.0 -2.0 -> -1
dqctm072 comparetotmag 0.0 -1.0 -> -1
dqctm073 comparetotmag 0.0 0.0 -> 0
dqctm074 comparetotmag 0.0 1.0 -> -1
dqctm075 comparetotmag 0.0 2.0 -> -1
dqctm076 comparetotmag 1.0 -2.0 -> -1
dqctm077 comparetotmag 1.0 -1.0 -> 0
dqctm078 comparetotmag 1.0 0.0 -> 1
dqctm079 comparetotmag 1.0 1.0 -> 0
dqctm080 comparetotmag 1.0 2.0 -> -1
dqctm081 comparetotmag 2.0 -2.0 -> 0
dqctm082 comparetotmag 2.0 -1.0 -> 1
dqctm083 comparetotmag 2.0 0.0 -> 1
dqctm085 comparetotmag 2.0 1.0 -> 1
dqctm086 comparetotmag 2.0 2.0 -> 0
-- now some cases which might overflow if subtract were used
dqctm090 comparetotmag 9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> 0
dqctm091 comparetotmag -9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> 0
dqctm092 comparetotmag 9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 0
dqctm093 comparetotmag -9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 0
-- some differing length/exponent cases
-- in this first group, compare would compare all equal
dqctm100 comparetotmag 7.0 7.0 -> 0
dqctm101 comparetotmag 7.0 7 -> -1
dqctm102 comparetotmag 7 7.0 -> 1
dqctm103 comparetotmag 7E+0 7.0 -> 1
dqctm104 comparetotmag 70E-1 7.0 -> 0
dqctm105 comparetotmag 0.7E+1 7 -> 0
dqctm106 comparetotmag 70E-1 7 -> -1
dqctm107 comparetotmag 7.0 7E+0 -> -1
dqctm108 comparetotmag 7.0 70E-1 -> 0
dqctm109 comparetotmag 7 0.7E+1 -> 0
dqctm110 comparetotmag 7 70E-1 -> 1
dqctm120 comparetotmag 8.0 7.0 -> 1
dqctm121 comparetotmag 8.0 7 -> 1
dqctm122 comparetotmag 8 7.0 -> 1
dqctm123 comparetotmag 8E+0 7.0 -> 1
dqctm124 comparetotmag 80E-1 7.0 -> 1
dqctm125 comparetotmag 0.8E+1 7 -> 1
dqctm126 comparetotmag 80E-1 7 -> 1
dqctm127 comparetotmag 8.0 7E+0 -> 1
dqctm128 comparetotmag 8.0 70E-1 -> 1
dqctm129 comparetotmag 8 0.7E+1 -> 1
dqctm130 comparetotmag 8 70E-1 -> 1
dqctm140 comparetotmag 8.0 9.0 -> -1
dqctm141 comparetotmag 8.0 9 -> -1
dqctm142 comparetotmag 8 9.0 -> -1
dqctm143 comparetotmag 8E+0 9.0 -> -1
dqctm144 comparetotmag 80E-1 9.0 -> -1
dqctm145 comparetotmag 0.8E+1 9 -> -1
dqctm146 comparetotmag 80E-1 9 -> -1
dqctm147 comparetotmag 8.0 9E+0 -> -1
dqctm148 comparetotmag 8.0 90E-1 -> -1
dqctm149 comparetotmag 8 0.9E+1 -> -1
dqctm150 comparetotmag 8 90E-1 -> -1
-- and again, with sign changes -+ ..
dqctm200 comparetotmag -7.0 7.0 -> 0
dqctm201 comparetotmag -7.0 7 -> -1
dqctm202 comparetotmag -7 7.0 -> 1
dqctm203 comparetotmag -7E+0 7.0 -> 1
dqctm204 comparetotmag -70E-1 7.0 -> 0
dqctm205 comparetotmag -0.7E+1 7 -> 0
dqctm206 comparetotmag -70E-1 7 -> -1
dqctm207 comparetotmag -7.0 7E+0 -> -1
dqctm208 comparetotmag -7.0 70E-1 -> 0
dqctm209 comparetotmag -7 0.7E+1 -> 0
dqctm210 comparetotmag -7 70E-1 -> 1
dqctm220 comparetotmag -8.0 7.0 -> 1
dqctm221 comparetotmag -8.0 7 -> 1
dqctm222 comparetotmag -8 7.0 -> 1
dqctm223 comparetotmag -8E+0 7.0 -> 1
dqctm224 comparetotmag -80E-1 7.0 -> 1
dqctm225 comparetotmag -0.8E+1 7 -> 1
dqctm226 comparetotmag -80E-1 7 -> 1
dqctm227 comparetotmag -8.0 7E+0 -> 1
dqctm228 comparetotmag -8.0 70E-1 -> 1
dqctm229 comparetotmag -8 0.7E+1 -> 1
dqctm230 comparetotmag -8 70E-1 -> 1
dqctm240 comparetotmag -8.0 9.0 -> -1
dqctm241 comparetotmag -8.0 9 -> -1
dqctm242 comparetotmag -8 9.0 -> -1
dqctm243 comparetotmag -8E+0 9.0 -> -1
dqctm244 comparetotmag -80E-1 9.0 -> -1
dqctm245 comparetotmag -0.8E+1 9 -> -1
dqctm246 comparetotmag -80E-1 9 -> -1
dqctm247 comparetotmag -8.0 9E+0 -> -1
dqctm248 comparetotmag -8.0 90E-1 -> -1
dqctm249 comparetotmag -8 0.9E+1 -> -1
dqctm250 comparetotmag -8 90E-1 -> -1
-- and again, with sign changes +- ..
dqctm300 comparetotmag 7.0 -7.0 -> 0
dqctm301 comparetotmag 7.0 -7 -> -1
dqctm302 comparetotmag 7 -7.0 -> 1
dqctm303 comparetotmag 7E+0 -7.0 -> 1
dqctm304 comparetotmag 70E-1 -7.0 -> 0
dqctm305 comparetotmag .7E+1 -7 -> 0
dqctm306 comparetotmag 70E-1 -7 -> -1
dqctm307 comparetotmag 7.0 -7E+0 -> -1
dqctm308 comparetotmag 7.0 -70E-1 -> 0
dqctm309 comparetotmag 7 -.7E+1 -> 0
dqctm310 comparetotmag 7 -70E-1 -> 1
dqctm320 comparetotmag 8.0 -7.0 -> 1
dqctm321 comparetotmag 8.0 -7 -> 1
dqctm322 comparetotmag 8 -7.0 -> 1
dqctm323 comparetotmag 8E+0 -7.0 -> 1
dqctm324 comparetotmag 80E-1 -7.0 -> 1
dqctm325 comparetotmag .8E+1 -7 -> 1
dqctm326 comparetotmag 80E-1 -7 -> 1
dqctm327 comparetotmag 8.0 -7E+0 -> 1
dqctm328 comparetotmag 8.0 -70E-1 -> 1
dqctm329 comparetotmag 8 -.7E+1 -> 1
dqctm330 comparetotmag 8 -70E-1 -> 1
dqctm340 comparetotmag 8.0 -9.0 -> -1
dqctm341 comparetotmag 8.0 -9 -> -1
dqctm342 comparetotmag 8 -9.0 -> -1
dqctm343 comparetotmag 8E+0 -9.0 -> -1
dqctm344 comparetotmag 80E-1 -9.0 -> -1
dqctm345 comparetotmag .8E+1 -9 -> -1
dqctm346 comparetotmag 80E-1 -9 -> -1
dqctm347 comparetotmag 8.0 -9E+0 -> -1
dqctm348 comparetotmag 8.0 -90E-1 -> -1
dqctm349 comparetotmag 8 -.9E+1 -> -1
dqctm350 comparetotmag 8 -90E-1 -> -1
-- and again, with sign changes -- ..
dqctm400 comparetotmag -7.0 -7.0 -> 0
dqctm401 comparetotmag -7.0 -7 -> -1
dqctm402 comparetotmag -7 -7.0 -> 1
dqctm403 comparetotmag -7E+0 -7.0 -> 1
dqctm404 comparetotmag -70E-1 -7.0 -> 0
dqctm405 comparetotmag -.7E+1 -7 -> 0
dqctm406 comparetotmag -70E-1 -7 -> -1
dqctm407 comparetotmag -7.0 -7E+0 -> -1
dqctm408 comparetotmag -7.0 -70E-1 -> 0
dqctm409 comparetotmag -7 -.7E+1 -> 0
dqctm410 comparetotmag -7 -70E-1 -> 1
dqctm420 comparetotmag -8.0 -7.0 -> 1
dqctm421 comparetotmag -8.0 -7 -> 1
dqctm422 comparetotmag -8 -7.0 -> 1
dqctm423 comparetotmag -8E+0 -7.0 -> 1
dqctm424 comparetotmag -80E-1 -7.0 -> 1
dqctm425 comparetotmag -.8E+1 -7 -> 1
dqctm426 comparetotmag -80E-1 -7 -> 1
dqctm427 comparetotmag -8.0 -7E+0 -> 1
dqctm428 comparetotmag -8.0 -70E-1 -> 1
dqctm429 comparetotmag -8 -.7E+1 -> 1
dqctm430 comparetotmag -8 -70E-1 -> 1
dqctm440 comparetotmag -8.0 -9.0 -> -1
dqctm441 comparetotmag -8.0 -9 -> -1
dqctm442 comparetotmag -8 -9.0 -> -1
dqctm443 comparetotmag -8E+0 -9.0 -> -1
dqctm444 comparetotmag -80E-1 -9.0 -> -1
dqctm445 comparetotmag -.8E+1 -9 -> -1
dqctm446 comparetotmag -80E-1 -9 -> -1
dqctm447 comparetotmag -8.0 -9E+0 -> -1
dqctm448 comparetotmag -8.0 -90E-1 -> -1
dqctm449 comparetotmag -8 -.9E+1 -> -1
dqctm450 comparetotmag -8 -90E-1 -> -1
-- testcases that subtract to lots of zeros at boundaries [pgr]
dqctm473 comparetotmag 123.4560000000000E-89 123.456E-89 -> -1
dqctm474 comparetotmag 123.456000000000E+89 123.456E+89 -> -1
dqctm475 comparetotmag 123.45600000000E-89 123.456E-89 -> -1
dqctm476 comparetotmag 123.4560000000E+89 123.456E+89 -> -1
dqctm477 comparetotmag 123.456000000E-89 123.456E-89 -> -1
dqctm478 comparetotmag 123.45600000E+89 123.456E+89 -> -1
dqctm479 comparetotmag 123.4560000E-89 123.456E-89 -> -1
dqctm480 comparetotmag 123.456000E+89 123.456E+89 -> -1
dqctm481 comparetotmag 123.45600E-89 123.456E-89 -> -1
dqctm482 comparetotmag 123.4560E+89 123.456E+89 -> -1
dqctm483 comparetotmag 123.456E-89 123.456E-89 -> 0
dqctm487 comparetotmag 123.456E+89 123.4560000000000E+89 -> 1
dqctm488 comparetotmag 123.456E-89 123.456000000000E-89 -> 1
dqctm489 comparetotmag 123.456E+89 123.45600000000E+89 -> 1
dqctm490 comparetotmag 123.456E-89 123.4560000000E-89 -> 1
dqctm491 comparetotmag 123.456E+89 123.456000000E+89 -> 1
dqctm492 comparetotmag 123.456E-89 123.45600000E-89 -> 1
dqctm493 comparetotmag 123.456E+89 123.4560000E+89 -> 1
dqctm494 comparetotmag 123.456E-89 123.456000E-89 -> 1
dqctm495 comparetotmag 123.456E+89 123.45600E+89 -> 1
dqctm496 comparetotmag 123.456E-89 123.4560E-89 -> 1
dqctm497 comparetotmag 123.456E+89 123.456E+89 -> 0
-- wide-ranging, around precision; signs equal
dqctm498 comparetotmag 1 1E-17 -> 1
dqctm499 comparetotmag 1 1E-16 -> 1
dqctm500 comparetotmag 1 1E-15 -> 1
dqctm501 comparetotmag 1 1E-14 -> 1
dqctm502 comparetotmag 1 1E-13 -> 1
dqctm503 comparetotmag 1 1E-12 -> 1
dqctm504 comparetotmag 1 1E-11 -> 1
dqctm505 comparetotmag 1 1E-10 -> 1
dqctm506 comparetotmag 1 1E-9 -> 1
dqctm507 comparetotmag 1 1E-8 -> 1
dqctm508 comparetotmag 1 1E-7 -> 1
dqctm509 comparetotmag 1 1E-6 -> 1
dqctm510 comparetotmag 1 1E-5 -> 1
dqctm511 comparetotmag 1 1E-4 -> 1
dqctm512 comparetotmag 1 1E-3 -> 1
dqctm513 comparetotmag 1 1E-2 -> 1
dqctm514 comparetotmag 1 1E-1 -> 1
dqctm515 comparetotmag 1 1E-0 -> 0
dqctm516 comparetotmag 1 1E+1 -> -1
dqctm517 comparetotmag 1 1E+2 -> -1
dqctm518 comparetotmag 1 1E+3 -> -1
dqctm519 comparetotmag 1 1E+4 -> -1
dqctm521 comparetotmag 1 1E+5 -> -1
dqctm522 comparetotmag 1 1E+6 -> -1
dqctm523 comparetotmag 1 1E+7 -> -1
dqctm524 comparetotmag 1 1E+8 -> -1
dqctm525 comparetotmag 1 1E+9 -> -1
dqctm526 comparetotmag 1 1E+10 -> -1
dqctm527 comparetotmag 1 1E+11 -> -1
dqctm528 comparetotmag 1 1E+12 -> -1
dqctm529 comparetotmag 1 1E+13 -> -1
dqctm530 comparetotmag 1 1E+14 -> -1
dqctm531 comparetotmag 1 1E+15 -> -1
dqctm532 comparetotmag 1 1E+16 -> -1
dqctm533 comparetotmag 1 1E+17 -> -1
-- LR swap
dqctm538 comparetotmag 1E-17 1 -> -1
dqctm539 comparetotmag 1E-16 1 -> -1
dqctm540 comparetotmag 1E-15 1 -> -1
dqctm541 comparetotmag 1E-14 1 -> -1
dqctm542 comparetotmag 1E-13 1 -> -1
dqctm543 comparetotmag 1E-12 1 -> -1
dqctm544 comparetotmag 1E-11 1 -> -1
dqctm545 comparetotmag 1E-10 1 -> -1
dqctm546 comparetotmag 1E-9 1 -> -1
dqctm547 comparetotmag 1E-8 1 -> -1
dqctm548 comparetotmag 1E-7 1 -> -1
dqctm549 comparetotmag 1E-6 1 -> -1
dqctm550 comparetotmag 1E-5 1 -> -1
dqctm551 comparetotmag 1E-4 1 -> -1
Loading ...