1------------------------------------------------------------------------ 2-- comparetotal.decTest -- decimal comparison using total ordering -- 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@uk.ibm.com -- 19------------------------------------------------------------------------ 20version: 2.59 21 22-- Note that we cannot assume add/subtract tests cover paths adequately, 23-- here, because the code might be quite different (comparison cannot 24-- overflow or underflow, so actual subtractions are not necessary). 25-- Similarly, comparetotal will have some radically different paths 26-- than compare. 27 28extended: 1 29precision: 16 30rounding: half_up 31maxExponent: 384 32minExponent: -383 33 34-- sanity checks 35cotx001 comparetotal -2 -2 -> 0 36cotx002 comparetotal -2 -1 -> -1 37cotx003 comparetotal -2 0 -> -1 38cotx004 comparetotal -2 1 -> -1 39cotx005 comparetotal -2 2 -> -1 40cotx006 comparetotal -1 -2 -> 1 41cotx007 comparetotal -1 -1 -> 0 42cotx008 comparetotal -1 0 -> -1 43cotx009 comparetotal -1 1 -> -1 44cotx010 comparetotal -1 2 -> -1 45cotx011 comparetotal 0 -2 -> 1 46cotx012 comparetotal 0 -1 -> 1 47cotx013 comparetotal 0 0 -> 0 48cotx014 comparetotal 0 1 -> -1 49cotx015 comparetotal 0 2 -> -1 50cotx016 comparetotal 1 -2 -> 1 51cotx017 comparetotal 1 -1 -> 1 52cotx018 comparetotal 1 0 -> 1 53cotx019 comparetotal 1 1 -> 0 54cotx020 comparetotal 1 2 -> -1 55cotx021 comparetotal 2 -2 -> 1 56cotx022 comparetotal 2 -1 -> 1 57cotx023 comparetotal 2 0 -> 1 58cotx025 comparetotal 2 1 -> 1 59cotx026 comparetotal 2 2 -> 0 60 61cotx031 comparetotal -20 -20 -> 0 62cotx032 comparetotal -20 -10 -> -1 63cotx033 comparetotal -20 00 -> -1 64cotx034 comparetotal -20 10 -> -1 65cotx035 comparetotal -20 20 -> -1 66cotx036 comparetotal -10 -20 -> 1 67cotx037 comparetotal -10 -10 -> 0 68cotx038 comparetotal -10 00 -> -1 69cotx039 comparetotal -10 10 -> -1 70cotx040 comparetotal -10 20 -> -1 71cotx041 comparetotal 00 -20 -> 1 72cotx042 comparetotal 00 -10 -> 1 73cotx043 comparetotal 00 00 -> 0 74cotx044 comparetotal 00 10 -> -1 75cotx045 comparetotal 00 20 -> -1 76cotx046 comparetotal 10 -20 -> 1 77cotx047 comparetotal 10 -10 -> 1 78cotx048 comparetotal 10 00 -> 1 79cotx049 comparetotal 10 10 -> 0 80cotx050 comparetotal 10 20 -> -1 81cotx051 comparetotal 20 -20 -> 1 82cotx052 comparetotal 20 -10 -> 1 83cotx053 comparetotal 20 00 -> 1 84cotx055 comparetotal 20 10 -> 1 85cotx056 comparetotal 20 20 -> 0 86 87cotx061 comparetotal -2.0 -2.0 -> 0 88cotx062 comparetotal -2.0 -1.0 -> -1 89cotx063 comparetotal -2.0 0.0 -> -1 90cotx064 comparetotal -2.0 1.0 -> -1 91cotx065 comparetotal -2.0 2.0 -> -1 92cotx066 comparetotal -1.0 -2.0 -> 1 93cotx067 comparetotal -1.0 -1.0 -> 0 94cotx068 comparetotal -1.0 0.0 -> -1 95cotx069 comparetotal -1.0 1.0 -> -1 96cotx070 comparetotal -1.0 2.0 -> -1 97cotx071 comparetotal 0.0 -2.0 -> 1 98cotx072 comparetotal 0.0 -1.0 -> 1 99cotx073 comparetotal 0.0 0.0 -> 0 100cotx074 comparetotal 0.0 1.0 -> -1 101cotx075 comparetotal 0.0 2.0 -> -1 102cotx076 comparetotal 1.0 -2.0 -> 1 103cotx077 comparetotal 1.0 -1.0 -> 1 104cotx078 comparetotal 1.0 0.0 -> 1 105cotx079 comparetotal 1.0 1.0 -> 0 106cotx080 comparetotal 1.0 2.0 -> -1 107cotx081 comparetotal 2.0 -2.0 -> 1 108cotx082 comparetotal 2.0 -1.0 -> 1 109cotx083 comparetotal 2.0 0.0 -> 1 110cotx085 comparetotal 2.0 1.0 -> 1 111cotx086 comparetotal 2.0 2.0 -> 0 112 113-- now some cases which might overflow if subtract were used 114maxexponent: 999999999 115minexponent: -999999999 116cotx090 comparetotal 9.99999999E+999999999 9.99999999E+999999999 -> 0 117cotx091 comparetotal -9.99999999E+999999999 9.99999999E+999999999 -> -1 118cotx092 comparetotal 9.99999999E+999999999 -9.99999999E+999999999 -> 1 119cotx093 comparetotal -9.99999999E+999999999 -9.99999999E+999999999 -> 0 120 121-- Examples 122cotx094 comparetotal 12.73 127.9 -> -1 123cotx095 comparetotal -127 12 -> -1 124cotx096 comparetotal 12.30 12.3 -> -1 125cotx097 comparetotal 12.30 12.30 -> 0 126cotx098 comparetotal 12.3 12.300 -> 1 127cotx099 comparetotal 12.3 NaN -> -1 128 129-- some differing length/exponent cases 130-- in this first group, compare would compare all equal 131cotx100 comparetotal 7.0 7.0 -> 0 132cotx101 comparetotal 7.0 7 -> -1 133cotx102 comparetotal 7 7.0 -> 1 134cotx103 comparetotal 7E+0 7.0 -> 1 135cotx104 comparetotal 70E-1 7.0 -> 0 136cotx105 comparetotal 0.7E+1 7 -> 0 137cotx106 comparetotal 70E-1 7 -> -1 138cotx107 comparetotal 7.0 7E+0 -> -1 139cotx108 comparetotal 7.0 70E-1 -> 0 140cotx109 comparetotal 7 0.7E+1 -> 0 141cotx110 comparetotal 7 70E-1 -> 1 142 143cotx120 comparetotal 8.0 7.0 -> 1 144cotx121 comparetotal 8.0 7 -> 1 145cotx122 comparetotal 8 7.0 -> 1 146cotx123 comparetotal 8E+0 7.0 -> 1 147cotx124 comparetotal 80E-1 7.0 -> 1 148cotx125 comparetotal 0.8E+1 7 -> 1 149cotx126 comparetotal 80E-1 7 -> 1 150cotx127 comparetotal 8.0 7E+0 -> 1 151cotx128 comparetotal 8.0 70E-1 -> 1 152cotx129 comparetotal 8 0.7E+1 -> 1 153cotx130 comparetotal 8 70E-1 -> 1 154 155cotx140 comparetotal 8.0 9.0 -> -1 156cotx141 comparetotal 8.0 9 -> -1 157cotx142 comparetotal 8 9.0 -> -1 158cotx143 comparetotal 8E+0 9.0 -> -1 159cotx144 comparetotal 80E-1 9.0 -> -1 160cotx145 comparetotal 0.8E+1 9 -> -1 161cotx146 comparetotal 80E-1 9 -> -1 162cotx147 comparetotal 8.0 9E+0 -> -1 163cotx148 comparetotal 8.0 90E-1 -> -1 164cotx149 comparetotal 8 0.9E+1 -> -1 165cotx150 comparetotal 8 90E-1 -> -1 166 167-- and again, with sign changes -+ .. 168cotx200 comparetotal -7.0 7.0 -> -1 169cotx201 comparetotal -7.0 7 -> -1 170cotx202 comparetotal -7 7.0 -> -1 171cotx203 comparetotal -7E+0 7.0 -> -1 172cotx204 comparetotal -70E-1 7.0 -> -1 173cotx205 comparetotal -0.7E+1 7 -> -1 174cotx206 comparetotal -70E-1 7 -> -1 175cotx207 comparetotal -7.0 7E+0 -> -1 176cotx208 comparetotal -7.0 70E-1 -> -1 177cotx209 comparetotal -7 0.7E+1 -> -1 178cotx210 comparetotal -7 70E-1 -> -1 179 180cotx220 comparetotal -8.0 7.0 -> -1 181cotx221 comparetotal -8.0 7 -> -1 182cotx222 comparetotal -8 7.0 -> -1 183cotx223 comparetotal -8E+0 7.0 -> -1 184cotx224 comparetotal -80E-1 7.0 -> -1 185cotx225 comparetotal -0.8E+1 7 -> -1 186cotx226 comparetotal -80E-1 7 -> -1 187cotx227 comparetotal -8.0 7E+0 -> -1 188cotx228 comparetotal -8.0 70E-1 -> -1 189cotx229 comparetotal -8 0.7E+1 -> -1 190cotx230 comparetotal -8 70E-1 -> -1 191 192cotx240 comparetotal -8.0 9.0 -> -1 193cotx241 comparetotal -8.0 9 -> -1 194cotx242 comparetotal -8 9.0 -> -1 195cotx243 comparetotal -8E+0 9.0 -> -1 196cotx244 comparetotal -80E-1 9.0 -> -1 197cotx245 comparetotal -0.8E+1 9 -> -1 198cotx246 comparetotal -80E-1 9 -> -1 199cotx247 comparetotal -8.0 9E+0 -> -1 200cotx248 comparetotal -8.0 90E-1 -> -1 201cotx249 comparetotal -8 0.9E+1 -> -1 202cotx250 comparetotal -8 90E-1 -> -1 203 204-- and again, with sign changes +- .. 205cotx300 comparetotal 7.0 -7.0 -> 1 206cotx301 comparetotal 7.0 -7 -> 1 207cotx302 comparetotal 7 -7.0 -> 1 208cotx303 comparetotal 7E+0 -7.0 -> 1 209cotx304 comparetotal 70E-1 -7.0 -> 1 210cotx305 comparetotal .7E+1 -7 -> 1 211cotx306 comparetotal 70E-1 -7 -> 1 212cotx307 comparetotal 7.0 -7E+0 -> 1 213cotx308 comparetotal 7.0 -70E-1 -> 1 214cotx309 comparetotal 7 -.7E+1 -> 1 215cotx310 comparetotal 7 -70E-1 -> 1 216 217cotx320 comparetotal 8.0 -7.0 -> 1 218cotx321 comparetotal 8.0 -7 -> 1 219cotx322 comparetotal 8 -7.0 -> 1 220cotx323 comparetotal 8E+0 -7.0 -> 1 221cotx324 comparetotal 80E-1 -7.0 -> 1 222cotx325 comparetotal .8E+1 -7 -> 1 223cotx326 comparetotal 80E-1 -7 -> 1 224cotx327 comparetotal 8.0 -7E+0 -> 1 225cotx328 comparetotal 8.0 -70E-1 -> 1 226cotx329 comparetotal 8 -.7E+1 -> 1 227cotx330 comparetotal 8 -70E-1 -> 1 228 229cotx340 comparetotal 8.0 -9.0 -> 1 230cotx341 comparetotal 8.0 -9 -> 1 231cotx342 comparetotal 8 -9.0 -> 1 232cotx343 comparetotal 8E+0 -9.0 -> 1 233cotx344 comparetotal 80E-1 -9.0 -> 1 234cotx345 comparetotal .8E+1 -9 -> 1 235cotx346 comparetotal 80E-1 -9 -> 1 236cotx347 comparetotal 8.0 -9E+0 -> 1 237cotx348 comparetotal 8.0 -90E-1 -> 1 238cotx349 comparetotal 8 -.9E+1 -> 1 239cotx350 comparetotal 8 -90E-1 -> 1 240 241-- and again, with sign changes -- .. 242cotx400 comparetotal -7.0 -7.0 -> 0 243cotx401 comparetotal -7.0 -7 -> 1 244cotx402 comparetotal -7 -7.0 -> -1 245cotx403 comparetotal -7E+0 -7.0 -> -1 246cotx404 comparetotal -70E-1 -7.0 -> 0 247cotx405 comparetotal -.7E+1 -7 -> 0 248cotx406 comparetotal -70E-1 -7 -> 1 249cotx407 comparetotal -7.0 -7E+0 -> 1 250cotx408 comparetotal -7.0 -70E-1 -> 0 251cotx409 comparetotal -7 -.7E+1 -> 0 252cotx410 comparetotal -7 -70E-1 -> -1 253 254cotx420 comparetotal -8.0 -7.0 -> -1 255cotx421 comparetotal -8.0 -7 -> -1 256cotx422 comparetotal -8 -7.0 -> -1 257cotx423 comparetotal -8E+0 -7.0 -> -1 258cotx424 comparetotal -80E-1 -7.0 -> -1 259cotx425 comparetotal -.8E+1 -7 -> -1 260cotx426 comparetotal -80E-1 -7 -> -1 261cotx427 comparetotal -8.0 -7E+0 -> -1 262cotx428 comparetotal -8.0 -70E-1 -> -1 263cotx429 comparetotal -8 -.7E+1 -> -1 264cotx430 comparetotal -8 -70E-1 -> -1 265 266cotx440 comparetotal -8.0 -9.0 -> 1 267cotx441 comparetotal -8.0 -9 -> 1 268cotx442 comparetotal -8 -9.0 -> 1 269cotx443 comparetotal -8E+0 -9.0 -> 1 270cotx444 comparetotal -80E-1 -9.0 -> 1 271cotx445 comparetotal -.8E+1 -9 -> 1 272cotx446 comparetotal -80E-1 -9 -> 1 273cotx447 comparetotal -8.0 -9E+0 -> 1 274cotx448 comparetotal -8.0 -90E-1 -> 1 275cotx449 comparetotal -8 -.9E+1 -> 1 276cotx450 comparetotal -8 -90E-1 -> 1 277 278 279-- testcases that subtract to lots of zeros at boundaries [pgr] 280precision: 40 281cotx470 comparetotal 123.4560000000000000E789 123.456E789 -> -1 282cotx471 comparetotal 123.456000000000000E-89 123.456E-89 -> -1 283cotx472 comparetotal 123.45600000000000E789 123.456E789 -> -1 284cotx473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1 285cotx474 comparetotal 123.456000000000E789 123.456E789 -> -1 286cotx475 comparetotal 123.45600000000E-89 123.456E-89 -> -1 287cotx476 comparetotal 123.4560000000E789 123.456E789 -> -1 288cotx477 comparetotal 123.456000000E-89 123.456E-89 -> -1 289cotx478 comparetotal 123.45600000E789 123.456E789 -> -1 290cotx479 comparetotal 123.4560000E-89 123.456E-89 -> -1 291cotx480 comparetotal 123.456000E789 123.456E789 -> -1 292cotx481 comparetotal 123.45600E-89 123.456E-89 -> -1 293cotx482 comparetotal 123.4560E789 123.456E789 -> -1 294cotx483 comparetotal 123.456E-89 123.456E-89 -> 0 295cotx484 comparetotal 123.456E-89 123.4560000000000000E-89 -> 1 296cotx485 comparetotal 123.456E789 123.456000000000000E789 -> 1 297cotx486 comparetotal 123.456E-89 123.45600000000000E-89 -> 1 298cotx487 comparetotal 123.456E789 123.4560000000000E789 -> 1 299cotx488 comparetotal 123.456E-89 123.456000000000E-89 -> 1 300cotx489 comparetotal 123.456E789 123.45600000000E789 -> 1 301cotx490 comparetotal 123.456E-89 123.4560000000E-89 -> 1 302cotx491 comparetotal 123.456E789 123.456000000E789 -> 1 303cotx492 comparetotal 123.456E-89 123.45600000E-89 -> 1 304cotx493 comparetotal 123.456E789 123.4560000E789 -> 1 305cotx494 comparetotal 123.456E-89 123.456000E-89 -> 1 306cotx495 comparetotal 123.456E789 123.45600E789 -> 1 307cotx496 comparetotal 123.456E-89 123.4560E-89 -> 1 308cotx497 comparetotal 123.456E789 123.456E789 -> 0 309 310-- wide-ranging, around precision; signs equal 311precision: 9 312cotx500 comparetotal 1 1E-15 -> 1 313cotx501 comparetotal 1 1E-14 -> 1 314cotx502 comparetotal 1 1E-13 -> 1 315cotx503 comparetotal 1 1E-12 -> 1 316cotx504 comparetotal 1 1E-11 -> 1 317cotx505 comparetotal 1 1E-10 -> 1 318cotx506 comparetotal 1 1E-9 -> 1 319cotx507 comparetotal 1 1E-8 -> 1 320cotx508 comparetotal 1 1E-7 -> 1 321cotx509 comparetotal 1 1E-6 -> 1 322cotx510 comparetotal 1 1E-5 -> 1 323cotx511 comparetotal 1 1E-4 -> 1 324cotx512 comparetotal 1 1E-3 -> 1 325cotx513 comparetotal 1 1E-2 -> 1 326cotx514 comparetotal 1 1E-1 -> 1 327cotx515 comparetotal 1 1E-0 -> 0 328cotx516 comparetotal 1 1E+1 -> -1 329cotx517 comparetotal 1 1E+2 -> -1 330cotx518 comparetotal 1 1E+3 -> -1 331cotx519 comparetotal 1 1E+4 -> -1 332cotx521 comparetotal 1 1E+5 -> -1 333cotx522 comparetotal 1 1E+6 -> -1 334cotx523 comparetotal 1 1E+7 -> -1 335cotx524 comparetotal 1 1E+8 -> -1 336cotx525 comparetotal 1 1E+9 -> -1 337cotx526 comparetotal 1 1E+10 -> -1 338cotx527 comparetotal 1 1E+11 -> -1 339cotx528 comparetotal 1 1E+12 -> -1 340cotx529 comparetotal 1 1E+13 -> -1 341cotx530 comparetotal 1 1E+14 -> -1 342cotx531 comparetotal 1 1E+15 -> -1 343-- LR swap 344cotx540 comparetotal 1E-15 1 -> -1 345cotx541 comparetotal 1E-14 1 -> -1 346cotx542 comparetotal 1E-13 1 -> -1 347cotx543 comparetotal 1E-12 1 -> -1 348cotx544 comparetotal 1E-11 1 -> -1 349cotx545 comparetotal 1E-10 1 -> -1 350cotx546 comparetotal 1E-9 1 -> -1 351cotx547 comparetotal 1E-8 1 -> -1 352cotx548 comparetotal 1E-7 1 -> -1 353cotx549 comparetotal 1E-6 1 -> -1 354cotx550 comparetotal 1E-5 1 -> -1 355cotx551 comparetotal 1E-4 1 -> -1 356cotx552 comparetotal 1E-3 1 -> -1 357cotx553 comparetotal 1E-2 1 -> -1 358cotx554 comparetotal 1E-1 1 -> -1 359cotx555 comparetotal 1E-0 1 -> 0 360cotx556 comparetotal 1E+1 1 -> 1 361cotx557 comparetotal 1E+2 1 -> 1 362cotx558 comparetotal 1E+3 1 -> 1 363cotx559 comparetotal 1E+4 1 -> 1 364cotx561 comparetotal 1E+5 1 -> 1 365cotx562 comparetotal 1E+6 1 -> 1 366cotx563 comparetotal 1E+7 1 -> 1 367cotx564 comparetotal 1E+8 1 -> 1 368cotx565 comparetotal 1E+9 1 -> 1 369cotx566 comparetotal 1E+10 1 -> 1 370cotx567 comparetotal 1E+11 1 -> 1 371cotx568 comparetotal 1E+12 1 -> 1 372cotx569 comparetotal 1E+13 1 -> 1 373cotx570 comparetotal 1E+14 1 -> 1 374cotx571 comparetotal 1E+15 1 -> 1 375-- similar with an useful coefficient, one side only 376cotx580 comparetotal 0.000000987654321 1E-15 -> 1 377cotx581 comparetotal 0.000000987654321 1E-14 -> 1 378cotx582 comparetotal 0.000000987654321 1E-13 -> 1 379cotx583 comparetotal 0.000000987654321 1E-12 -> 1 380cotx584 comparetotal 0.000000987654321 1E-11 -> 1 381cotx585 comparetotal 0.000000987654321 1E-10 -> 1 382cotx586 comparetotal 0.000000987654321 1E-9 -> 1 383cotx587 comparetotal 0.000000987654321 1E-8 -> 1 384cotx588 comparetotal 0.000000987654321 1E-7 -> 1 385cotx589 comparetotal 0.000000987654321 1E-6 -> -1 386cotx590 comparetotal 0.000000987654321 1E-5 -> -1 387cotx591 comparetotal 0.000000987654321 1E-4 -> -1 388cotx592 comparetotal 0.000000987654321 1E-3 -> -1 389cotx593 comparetotal 0.000000987654321 1E-2 -> -1 390cotx594 comparetotal 0.000000987654321 1E-1 -> -1 391cotx595 comparetotal 0.000000987654321 1E-0 -> -1 392cotx596 comparetotal 0.000000987654321 1E+1 -> -1 393cotx597 comparetotal 0.000000987654321 1E+2 -> -1 394cotx598 comparetotal 0.000000987654321 1E+3 -> -1 395cotx599 comparetotal 0.000000987654321 1E+4 -> -1 396 397-- check some unit-y traps 398precision: 20 399cotx600 comparetotal 12 12.2345 -> -1 400cotx601 comparetotal 12.0 12.2345 -> -1 401cotx602 comparetotal 12.00 12.2345 -> -1 402cotx603 comparetotal 12.000 12.2345 -> -1 403cotx604 comparetotal 12.0000 12.2345 -> -1 404cotx605 comparetotal 12.00000 12.2345 -> -1 405cotx606 comparetotal 12.000000 12.2345 -> -1 406cotx607 comparetotal 12.0000000 12.2345 -> -1 407cotx608 comparetotal 12.00000000 12.2345 -> -1 408cotx609 comparetotal 12.000000000 12.2345 -> -1 409cotx610 comparetotal 12.1234 12 -> 1 410cotx611 comparetotal 12.1234 12.0 -> 1 411cotx612 comparetotal 12.1234 12.00 -> 1 412cotx613 comparetotal 12.1234 12.000 -> 1 413cotx614 comparetotal 12.1234 12.0000 -> 1 414cotx615 comparetotal 12.1234 12.00000 -> 1 415cotx616 comparetotal 12.1234 12.000000 -> 1 416cotx617 comparetotal 12.1234 12.0000000 -> 1 417cotx618 comparetotal 12.1234 12.00000000 -> 1 418cotx619 comparetotal 12.1234 12.000000000 -> 1 419cotx620 comparetotal -12 -12.2345 -> 1 420cotx621 comparetotal -12.0 -12.2345 -> 1 421cotx622 comparetotal -12.00 -12.2345 -> 1 422cotx623 comparetotal -12.000 -12.2345 -> 1 423cotx624 comparetotal -12.0000 -12.2345 -> 1 424cotx625 comparetotal -12.00000 -12.2345 -> 1 425cotx626 comparetotal -12.000000 -12.2345 -> 1 426cotx627 comparetotal -12.0000000 -12.2345 -> 1 427cotx628 comparetotal -12.00000000 -12.2345 -> 1 428cotx629 comparetotal -12.000000000 -12.2345 -> 1 429cotx630 comparetotal -12.1234 -12 -> -1 430cotx631 comparetotal -12.1234 -12.0 -> -1 431cotx632 comparetotal -12.1234 -12.00 -> -1 432cotx633 comparetotal -12.1234 -12.000 -> -1 433cotx634 comparetotal -12.1234 -12.0000 -> -1 434cotx635 comparetotal -12.1234 -12.00000 -> -1 435cotx636 comparetotal -12.1234 -12.000000 -> -1 436cotx637 comparetotal -12.1234 -12.0000000 -> -1 437cotx638 comparetotal -12.1234 -12.00000000 -> -1 438cotx639 comparetotal -12.1234 -12.000000000 -> -1 439precision: 9 440 441-- extended zeros 442cotx640 comparetotal 0 0 -> 0 443cotx641 comparetotal 0 -0 -> 1 444cotx642 comparetotal 0 -0.0 -> 1 445cotx643 comparetotal 0 0.0 -> 1 446cotx644 comparetotal -0 0 -> -1 447cotx645 comparetotal -0 -0 -> 0 448cotx646 comparetotal -0 -0.0 -> -1 449cotx647 comparetotal -0 0.0 -> -1 450cotx648 comparetotal 0.0 0 -> -1 451cotx649 comparetotal 0.0 -0 -> 1 452cotx650 comparetotal 0.0 -0.0 -> 1 453cotx651 comparetotal 0.0 0.0 -> 0 454cotx652 comparetotal -0.0 0 -> -1 455cotx653 comparetotal -0.0 -0 -> 1 456cotx654 comparetotal -0.0 -0.0 -> 0 457cotx655 comparetotal -0.0 0.0 -> -1 458 459cotx656 comparetotal -0E1 0.0 -> -1 460cotx657 comparetotal -0E2 0.0 -> -1 461cotx658 comparetotal 0E1 0.0 -> 1 462cotx659 comparetotal 0E2 0.0 -> 1 463cotx660 comparetotal -0E1 0 -> -1 464cotx661 comparetotal -0E2 0 -> -1 465cotx662 comparetotal 0E1 0 -> 1 466cotx663 comparetotal 0E2 0 -> 1 467cotx664 comparetotal -0E1 -0E1 -> 0 468cotx665 comparetotal -0E2 -0E1 -> -1 469cotx666 comparetotal 0E1 -0E1 -> 1 470cotx667 comparetotal 0E2 -0E1 -> 1 471cotx668 comparetotal -0E1 -0E2 -> 1 472cotx669 comparetotal -0E2 -0E2 -> 0 473cotx670 comparetotal 0E1 -0E2 -> 1 474cotx671 comparetotal 0E2 -0E2 -> 1 475cotx672 comparetotal -0E1 0E1 -> -1 476cotx673 comparetotal -0E2 0E1 -> -1 477cotx674 comparetotal 0E1 0E1 -> 0 478cotx675 comparetotal 0E2 0E1 -> 1 479cotx676 comparetotal -0E1 0E2 -> -1 480cotx677 comparetotal -0E2 0E2 -> -1 481cotx678 comparetotal 0E1 0E2 -> -1 482cotx679 comparetotal 0E2 0E2 -> 0 483 484-- trailing zeros; unit-y 485precision: 20 486cotx680 comparetotal 12 12 -> 0 487cotx681 comparetotal 12 12.0 -> 1 488cotx682 comparetotal 12 12.00 -> 1 489cotx683 comparetotal 12 12.000 -> 1 490cotx684 comparetotal 12 12.0000 -> 1 491cotx685 comparetotal 12 12.00000 -> 1 492cotx686 comparetotal 12 12.000000 -> 1 493cotx687 comparetotal 12 12.0000000 -> 1 494cotx688 comparetotal 12 12.00000000 -> 1 495cotx689 comparetotal 12 12.000000000 -> 1 496cotx690 comparetotal 12 12 -> 0 497cotx691 comparetotal 12.0 12 -> -1 498cotx692 comparetotal 12.00 12 -> -1 499cotx693 comparetotal 12.000 12 -> -1 500cotx694 comparetotal 12.0000 12 -> -1 501cotx695 comparetotal 12.00000 12 -> -1 502cotx696 comparetotal 12.000000 12 -> -1 503cotx697 comparetotal 12.0000000 12 -> -1 504cotx698 comparetotal 12.00000000 12 -> -1 505cotx699 comparetotal 12.000000000 12 -> -1 506 507-- long operand checks 508maxexponent: 999 509minexponent: -999 510precision: 9 511cotx701 comparetotal 12345678000 1 -> 1 512cotx702 comparetotal 1 12345678000 -> -1 513cotx703 comparetotal 1234567800 1 -> 1 514cotx704 comparetotal 1 1234567800 -> -1 515cotx705 comparetotal 1234567890 1 -> 1 516cotx706 comparetotal 1 1234567890 -> -1 517cotx707 comparetotal 1234567891 1 -> 1 518cotx708 comparetotal 1 1234567891 -> -1 519cotx709 comparetotal 12345678901 1 -> 1 520cotx710 comparetotal 1 12345678901 -> -1 521cotx711 comparetotal 1234567896 1 -> 1 522cotx712 comparetotal 1 1234567896 -> -1 523cotx713 comparetotal -1234567891 1 -> -1 524cotx714 comparetotal 1 -1234567891 -> 1 525cotx715 comparetotal -12345678901 1 -> -1 526cotx716 comparetotal 1 -12345678901 -> 1 527cotx717 comparetotal -1234567896 1 -> -1 528cotx718 comparetotal 1 -1234567896 -> 1 529 530precision: 15 531-- same with plenty of precision 532cotx721 comparetotal 12345678000 1 -> 1 533cotx722 comparetotal 1 12345678000 -> -1 534cotx723 comparetotal 1234567800 1 -> 1 535cotx724 comparetotal 1 1234567800 -> -1 536cotx725 comparetotal 1234567890 1 -> 1 537cotx726 comparetotal 1 1234567890 -> -1 538cotx727 comparetotal 1234567891 1 -> 1 539cotx728 comparetotal 1 1234567891 -> -1 540cotx729 comparetotal 12345678901 1 -> 1 541cotx730 comparetotal 1 12345678901 -> -1 542cotx731 comparetotal 1234567896 1 -> 1 543cotx732 comparetotal 1 1234567896 -> -1 544 545-- residue cases 546precision: 5 547cotx740 comparetotal 1 0.9999999 -> 1 548cotx741 comparetotal 1 0.999999 -> 1 549cotx742 comparetotal 1 0.99999 -> 1 550cotx743 comparetotal 1 1.0000 -> 1 551cotx744 comparetotal 1 1.00001 -> -1 552cotx745 comparetotal 1 1.000001 -> -1 553cotx746 comparetotal 1 1.0000001 -> -1 554cotx750 comparetotal 0.9999999 1 -> -1 555cotx751 comparetotal 0.999999 1 -> -1 556cotx752 comparetotal 0.99999 1 -> -1 557cotx753 comparetotal 1.0000 1 -> -1 558cotx754 comparetotal 1.00001 1 -> 1 559cotx755 comparetotal 1.000001 1 -> 1 560cotx756 comparetotal 1.0000001 1 -> 1 561 562-- a selection of longies 563cotx760 comparetotal -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> -1 564cotx761 comparetotal -36852134.84194296250843579428931 -36852134.84194296250843579428931 -> 0 565cotx762 comparetotal -36852134.94194296250843579428931 -36852134.84194296250843579428931 -> -1 566cotx763 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 567-- precisions above or below the difference should have no effect 568precision: 11 569cotx764 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 570precision: 10 571cotx765 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 572precision: 9 573cotx766 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 574precision: 8 575cotx767 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 576precision: 7 577cotx768 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 578precision: 6 579cotx769 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 580precision: 5 581cotx770 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 582precision: 4 583cotx771 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 584precision: 3 585cotx772 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 586precision: 2 587cotx773 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 588precision: 1 589cotx774 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 590 591-- Specials 592precision: 9 593cotx780 comparetotal Inf -Inf -> 1 594cotx781 comparetotal Inf -1000 -> 1 595cotx782 comparetotal Inf -1 -> 1 596cotx783 comparetotal Inf -0 -> 1 597cotx784 comparetotal Inf 0 -> 1 598cotx785 comparetotal Inf 1 -> 1 599cotx786 comparetotal Inf 1000 -> 1 600cotx787 comparetotal Inf Inf -> 0 601cotx788 comparetotal -1000 Inf -> -1 602cotx789 comparetotal -Inf Inf -> -1 603cotx790 comparetotal -1 Inf -> -1 604cotx791 comparetotal -0 Inf -> -1 605cotx792 comparetotal 0 Inf -> -1 606cotx793 comparetotal 1 Inf -> -1 607cotx794 comparetotal 1000 Inf -> -1 608cotx795 comparetotal Inf Inf -> 0 609 610cotx800 comparetotal -Inf -Inf -> 0 611cotx801 comparetotal -Inf -1000 -> -1 612cotx802 comparetotal -Inf -1 -> -1 613cotx803 comparetotal -Inf -0 -> -1 614cotx804 comparetotal -Inf 0 -> -1 615cotx805 comparetotal -Inf 1 -> -1 616cotx806 comparetotal -Inf 1000 -> -1 617cotx807 comparetotal -Inf Inf -> -1 618cotx808 comparetotal -Inf -Inf -> 0 619cotx809 comparetotal -1000 -Inf -> 1 620cotx810 comparetotal -1 -Inf -> 1 621cotx811 comparetotal -0 -Inf -> 1 622cotx812 comparetotal 0 -Inf -> 1 623cotx813 comparetotal 1 -Inf -> 1 624cotx814 comparetotal 1000 -Inf -> 1 625cotx815 comparetotal Inf -Inf -> 1 626 627cotx821 comparetotal NaN -Inf -> 1 628cotx822 comparetotal NaN -1000 -> 1 629cotx823 comparetotal NaN -1 -> 1 630cotx824 comparetotal NaN -0 -> 1 631cotx825 comparetotal NaN 0 -> 1 632cotx826 comparetotal NaN 1 -> 1 633cotx827 comparetotal NaN 1000 -> 1 634cotx828 comparetotal NaN Inf -> 1 635cotx829 comparetotal NaN NaN -> 0 636cotx830 comparetotal -Inf NaN -> -1 637cotx831 comparetotal -1000 NaN -> -1 638cotx832 comparetotal -1 NaN -> -1 639cotx833 comparetotal -0 NaN -> -1 640cotx834 comparetotal 0 NaN -> -1 641cotx835 comparetotal 1 NaN -> -1 642cotx836 comparetotal 1000 NaN -> -1 643cotx837 comparetotal Inf NaN -> -1 644cotx838 comparetotal -NaN -NaN -> 0 645cotx839 comparetotal +NaN -NaN -> 1 646cotx840 comparetotal -NaN +NaN -> -1 647 648cotx841 comparetotal sNaN -sNaN -> 1 649cotx842 comparetotal sNaN -NaN -> 1 650cotx843 comparetotal sNaN -Inf -> 1 651cotx844 comparetotal sNaN -1000 -> 1 652cotx845 comparetotal sNaN -1 -> 1 653cotx846 comparetotal sNaN -0 -> 1 654cotx847 comparetotal sNaN 0 -> 1 655cotx848 comparetotal sNaN 1 -> 1 656cotx849 comparetotal sNaN 1000 -> 1 657cotx850 comparetotal sNaN NaN -> -1 658cotx851 comparetotal sNaN sNaN -> 0 659 660cotx852 comparetotal -sNaN sNaN -> -1 661cotx853 comparetotal -NaN sNaN -> -1 662cotx854 comparetotal -Inf sNaN -> -1 663cotx855 comparetotal -1000 sNaN -> -1 664cotx856 comparetotal -1 sNaN -> -1 665cotx857 comparetotal -0 sNaN -> -1 666cotx858 comparetotal 0 sNaN -> -1 667cotx859 comparetotal 1 sNaN -> -1 668cotx860 comparetotal 1000 sNaN -> -1 669cotx861 comparetotal Inf sNaN -> -1 670cotx862 comparetotal NaN sNaN -> 1 671cotx863 comparetotal sNaN sNaN -> 0 672 673cotx871 comparetotal -sNaN -sNaN -> 0 674cotx872 comparetotal -sNaN -NaN -> 1 675cotx873 comparetotal -sNaN -Inf -> -1 676cotx874 comparetotal -sNaN -1000 -> -1 677cotx875 comparetotal -sNaN -1 -> -1 678cotx876 comparetotal -sNaN -0 -> -1 679cotx877 comparetotal -sNaN 0 -> -1 680cotx878 comparetotal -sNaN 1 -> -1 681cotx879 comparetotal -sNaN 1000 -> -1 682cotx880 comparetotal -sNaN NaN -> -1 683cotx881 comparetotal -sNaN sNaN -> -1 684 685cotx882 comparetotal -sNaN -sNaN -> 0 686cotx883 comparetotal -NaN -sNaN -> -1 687cotx884 comparetotal -Inf -sNaN -> 1 688cotx885 comparetotal -1000 -sNaN -> 1 689cotx886 comparetotal -1 -sNaN -> 1 690cotx887 comparetotal -0 -sNaN -> 1 691cotx888 comparetotal 0 -sNaN -> 1 692cotx889 comparetotal 1 -sNaN -> 1 693cotx890 comparetotal 1000 -sNaN -> 1 694cotx891 comparetotal Inf -sNaN -> 1 695cotx892 comparetotal NaN -sNaN -> 1 696cotx893 comparetotal sNaN -sNaN -> 1 697 698-- NaNs with payload 699cotx960 comparetotal NaN9 -Inf -> 1 700cotx961 comparetotal NaN8 999 -> 1 701cotx962 comparetotal NaN77 Inf -> 1 702cotx963 comparetotal -NaN67 NaN5 -> -1 703cotx964 comparetotal -Inf -NaN4 -> 1 704cotx965 comparetotal -999 -NaN33 -> 1 705cotx966 comparetotal Inf NaN2 -> -1 706 707cotx970 comparetotal -NaN41 -NaN42 -> 1 708cotx971 comparetotal +NaN41 -NaN42 -> 1 709cotx972 comparetotal -NaN41 +NaN42 -> -1 710cotx973 comparetotal +NaN41 +NaN42 -> -1 711cotx974 comparetotal -NaN42 -NaN01 -> -1 712cotx975 comparetotal +NaN42 -NaN01 -> 1 713cotx976 comparetotal -NaN42 +NaN01 -> -1 714cotx977 comparetotal +NaN42 +NaN01 -> 1 715 716cotx980 comparetotal -sNaN771 -sNaN772 -> 1 717cotx981 comparetotal +sNaN771 -sNaN772 -> 1 718cotx982 comparetotal -sNaN771 +sNaN772 -> -1 719cotx983 comparetotal +sNaN771 +sNaN772 -> -1 720cotx984 comparetotal -sNaN772 -sNaN771 -> -1 721cotx985 comparetotal +sNaN772 -sNaN771 -> 1 722cotx986 comparetotal -sNaN772 +sNaN771 -> -1 723cotx987 comparetotal +sNaN772 +sNaN771 -> 1 724 725cotx991 comparetotal -sNaN99 -Inf -> -1 726cotx992 comparetotal sNaN98 -11 -> 1 727cotx993 comparetotal sNaN97 NaN -> -1 728cotx994 comparetotal sNaN16 sNaN94 -> -1 729cotx995 comparetotal NaN85 sNaN83 -> 1 730cotx996 comparetotal -Inf sNaN92 -> -1 731cotx997 comparetotal 088 sNaN81 -> -1 732cotx998 comparetotal Inf sNaN90 -> -1 733cotx999 comparetotal NaN -sNaN89 -> 1 734 735-- overflow and underflow tests .. subnormal results now allowed 736maxExponent: 999999999 737minexponent: -999999999 738cotx1080 comparetotal +1.23456789012345E-0 9E+999999999 -> -1 739cotx1081 comparetotal 9E+999999999 +1.23456789012345E-0 -> 1 740cotx1082 comparetotal +0.100 9E-999999999 -> 1 741cotx1083 comparetotal 9E-999999999 +0.100 -> -1 742cotx1085 comparetotal -1.23456789012345E-0 9E+999999999 -> -1 743cotx1086 comparetotal 9E+999999999 -1.23456789012345E-0 -> 1 744cotx1087 comparetotal -0.100 9E-999999999 -> -1 745cotx1088 comparetotal 9E-999999999 -0.100 -> 1 746 747cotx1089 comparetotal 1e-599999999 1e-400000001 -> -1 748cotx1090 comparetotal 1e-599999999 1e-400000000 -> -1 749cotx1091 comparetotal 1e-600000000 1e-400000000 -> -1 750cotx1092 comparetotal 9e-999999998 0.01 -> -1 751cotx1093 comparetotal 9e-999999998 0.1 -> -1 752cotx1094 comparetotal 0.01 9e-999999998 -> 1 753cotx1095 comparetotal 1e599999999 1e400000001 -> 1 754cotx1096 comparetotal 1e599999999 1e400000000 -> 1 755cotx1097 comparetotal 1e600000000 1e400000000 -> 1 756cotx1098 comparetotal 9e999999998 100 -> 1 757cotx1099 comparetotal 9e999999998 10 -> 1 758cotx1100 comparetotal 100 9e999999998 -> -1 759-- signs 760cotx1101 comparetotal 1e+777777777 1e+411111111 -> 1 761cotx1102 comparetotal 1e+777777777 -1e+411111111 -> 1 762cotx1103 comparetotal -1e+777777777 1e+411111111 -> -1 763cotx1104 comparetotal -1e+777777777 -1e+411111111 -> -1 764cotx1105 comparetotal 1e-777777777 1e-411111111 -> -1 765cotx1106 comparetotal 1e-777777777 -1e-411111111 -> 1 766cotx1107 comparetotal -1e-777777777 1e-411111111 -> -1 767cotx1108 comparetotal -1e-777777777 -1e-411111111 -> 1 768 769-- spread zeros 770cotx1110 comparetotal 0E-383 0 -> -1 771cotx1111 comparetotal 0E-383 -0 -> 1 772cotx1112 comparetotal -0E-383 0 -> -1 773cotx1113 comparetotal -0E-383 -0 -> 1 774cotx1114 comparetotal 0E-383 0E+384 -> -1 775cotx1115 comparetotal 0E-383 -0E+384 -> 1 776cotx1116 comparetotal -0E-383 0E+384 -> -1 777cotx1117 comparetotal -0E-383 -0E+384 -> 1 778cotx1118 comparetotal 0 0E+384 -> -1 779cotx1119 comparetotal 0 -0E+384 -> 1 780cotx1120 comparetotal -0 0E+384 -> -1 781cotx1121 comparetotal -0 -0E+384 -> 1 782 783cotx1130 comparetotal 0E+384 0 -> 1 784cotx1131 comparetotal 0E+384 -0 -> 1 785cotx1132 comparetotal -0E+384 0 -> -1 786cotx1133 comparetotal -0E+384 -0 -> -1 787cotx1134 comparetotal 0E+384 0E-383 -> 1 788cotx1135 comparetotal 0E+384 -0E-383 -> 1 789cotx1136 comparetotal -0E+384 0E-383 -> -1 790cotx1137 comparetotal -0E+384 -0E-383 -> -1 791cotx1138 comparetotal 0 0E-383 -> 1 792cotx1139 comparetotal 0 -0E-383 -> 1 793cotx1140 comparetotal -0 0E-383 -> -1 794cotx1141 comparetotal -0 -0E-383 -> -1 795 796-- Null tests 797cotx9990 comparetotal 10 # -> NaN Invalid_operation 798cotx9991 comparetotal # 10 -> NaN Invalid_operation 799