1-- Selected test cases to reduce both the archive size and runtime. For the 2-- large test suite, download the separate mpdecimal-testdata distribution and 3-- replace the testdata_dist directory. 4 5rounding: half_even 6precision: 28 7maxexponent: 999999999 8minexponent: -999999999 9clamp: 0 10 11covx5000 power 0 123456789123456789123456789 -> 0 12covx5001 power 1 123456789123456789123456789 -> 1 13covx5004 power 1.0000000000000 123456789123456789123456789 -> 1.000000000000000000000000000 Rounded 14covx5008 power 1.000000001 12345676891234567891 -> Infinity Rounded Inexact Overflow 15covx5010 power 1.000000001 -12345676891234567891 -> 0E-1000000026 Rounded Underflow Inexact Clamped Subnormal 16 17rounding: down 18covx5011 power 2.2 123456789123456789123456788 -> 9.999999999999999999999999999E+999999999 Rounded Inexact Overflow 19 20rounding: down 21covx5012 power 2.2 2921000000.891239129 -> 9.999999999999999999999999999E+999999999 Rounded Inexact Overflow 22 23rounding: half_even 24precision: 5000 25covx5025 exp 1e20 -> Infinity Rounded Inexact Overflow 26 27rounding: half_even 28precision: 5000 29covx5026 exp -1e20 -> 0E-1000004998 Rounded Subnormal Clamped Underflow Inexact 30 31rounding: down 32precision: 4 33maxexponent: 4 34minexponent: -4 35covx5027 ln 1.000000000000000000001 -> 0E-7 Subnormal Inexact Clamped Underflow Rounded 36covx5028 ln 1e999999999 -> Infinity Inexact Overflow Rounded 37 38rounding: half_even 39precision: 1 40maxexponent: 1 41minexponent: -1 42covx5029 log10 1.000000000000000000001 -> 0.0 Subnormal Inexact Clamped Underflow Rounded 43 44rounding: half_even 45covx5030 log10 12345e100 -> Infinity Inexact Overflow Rounded 46 47rounding: half_up 48precision: 28 49maxexponent: 999999999 50minexponent: -999999999 51covx5031 log10 177.82794100389228012254211972400046751027254035861481049206983723942104337400734839183756638300367799 -> 2.250000000000000000000000001 Inexact Rounded 52 53rounding: half_even 54precision: 10000 55covx5034 rotate 1234 12345678901234567890 -> NaN Invalid_operation 56 57rounding: half_up 58precision: 24 59maxexponent: 999999999 60minexponent: -999999999 61covx5048 remaindernear 999999999999999999999999.5 1 -> NaN Division_impossible 62covx5051 remaindernear 999999999999999999999998.5 1 -> 0.5 63 64rounding: half_even 65precision: 28 66maxexponent: 99 67minexponent: -99 68covx5056 apply 9999999999999999999999999999E-127 -> 1.000000000000000000000000000E-99 Underflow Subnormal Rounded Inexact 69covx5057 quantize 9999999999999999999999999999e71 1e72 -> 1.000000000000000000000000000E+99 Rounded Inexact 70 71rounding: half_even 72precision: 58 73maxexponent: 99 74minexponent: -99 75covx5058 apply 999999999999999999999999999999999999999999999999E-159 -> 1.000000000000000000000000000000000000000000000E-111 Underflow Subnormal Rounded Inexact 76covx5059 quantize 999999999999999999999999999999999999999999999999e51 1e52 -> 1.00000000000000000000000000000000000000000000000E+99 Rounded Inexact 77 78covx5060 tointegralx 999999999999999999999999999999999999999999999.9 -> 1000000000000000000000000000000000000000000000 Inexact Rounded 79covx5061 tointegralx 9999999999999999999999999999999999999999999999999999999999999999999999999999.9 -> 10000000000000000000000000000000000000000000000000000000000000000000000000000 Inexact Rounded 80 81rounding: half_even 82precision: 2000 83maxexponent: 999999999 84minexponent: -999999999 85 86covx5071 quantize 9999999999999999999999999999999999999999999999999999999999 1e1 -> 1.000000000000000000000000000000000000000000000000000000000E+58 Rounded Inexact 87covx5072 and 100000010010011000000000000000000000000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000001000000000000 1081000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000010101000000000000000000000000000000000000000000000000000000000000000000000000000000100001010010100000100101010000101000100000100101000100100000010001010010000000000000000000000000000000000010101001010000000000000000000000000000000000000000001 -> NaN Invalid_operation 88covx5073 invert 1081000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000010101000000000000000000000000000000000000000000000000000000000000000000000000000000100001010010100000100101010000101000100000100101000100100000010001010010000000000000000000000000000000000010101001010000000000000000000000000000000000000000001 -> NaN Invalid_operation 89covx5074 or 100000010010011000000000000000000000000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000001000000000000 1081000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000010101000000000000000000000000000000000000000000000000000000000000000000000000000000100001010010100000100101010000101000100000100101000100100000010001010010000000000000000000000000000000000010101001010000000000000000000000000000000000000000001 -> NaN Invalid_operation 90covx5075 xor 100000010010011000000000000000000000000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000001000000000000 1081000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000010101000000000000000000000000000000000000000000000000000000000000000000000000000000100001010010100000100101010000101000100000100101000100100000010001010010000000000000000000000000000000000010101001010000000000000000000000000000000000000000001 -> NaN Invalid_operation 91 92rounding: half_even 93precision: 28 94covx5076 shift 123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789 -20 -> 91234567 95 96rounding: half_even 97precision: 80 98covx5077 reduce 9892345673.0123456780000000000000000000000000000000000000000000000000000000000000000000000 -> 9892345673.012345678 Rounded 99 100rounding: down 101precision: 28 102covx5078 resc Infinity 425000000 -> Infinity 103covx50780 resc NaN 425000000 -> NaN 104covx50782 resc sNaN 425000000 -> sNaN 105covx50783 resc 0 425000000 -> 0E+425000000 106 107cov64x50784 resc 1e999999999999999999 -1000 -> NaN Invalid_operation 108cov32x50785 resc 1e425000000 -1000 -> NaN Invalid_operation 109 110rounding: half_even 111precision: 58 112maxexponent: 99 113minexponent: -99 114covx5079 resc 999999999e200 100 -> 9.999999990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+208 115 116rounding: half_even 117covx5080 resc 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999e100 120 -> 1.0000000000000000000000000000000000000000000000000000000000000000000000E+190 Inexact Rounded 118 119rounding: half_even 120precision: 58 121maxexponent: 999 122minexponent: -999 123covx5081 resc 1E-1000 -1005 -> 1.00000E-1000 Subnormal 124 125-- extreme cases for NaN payloads 126maxexponent: 1 127minexponent: -1 128precision: 1 129clamp: 1 130covx5082 plus NaN123 -> NaN 131covx5083 plus NaN0 -> NaN 132 133-- decapitating leads to NaN0 => NaN 134maxexponent: 999 135minexponent: -999 136precision: 6 137covx5084 plus NaN123000000 -> NaN 138covx5085 plus NaN12300000 -> NaN 139covx5086 plus NaN1230000 -> NaN30000 140 141clamp: 0 142covx5087 plus NaN123000000 -> NaN 143covx5088 plus NaN12300000 -> NaN300000 144covx5089 plus NaN1230000 -> NaN230000 145 146 147-- floor, ceil, trunc 148rounding: half_even 149precision: 2000 150maxexponent: 999 151minexponent: -999 152clamp: 0 153 154floor10000 floor 0 -> 0 155floor10001 floor 0.0 -> 0 156floor10002 floor -0.0 -> -0 157floor10003 floor 1e-200 -> 0 158floor10004 floor -1e-200 -> -1 159floor10005 floor 0.5 -> 0 160floor10006 floor -0.5 -> -1 161floor10007 floor 0.999999999999 -> 0 162floor10008 floor -0.99999999999 -> -1 163floor10009 floor -1.0 -> -1 164floor10010 floor 1.0 -> 1 165floor10011 floor 9.9 -> 9 166floor10012 floor -9.9 -> -10 167floor10013 floor 9.333e+80 -> 9.333E+80 168floor10014 floor -9.333e+80 -> -9.333E+80 169floor10015 floor 100.0 -> 100 170floor10016 floor -100.0 -> -100 171ceil10017 ceil 0 -> 0 172ceil10018 ceil 0.0 -> 0 173ceil10019 ceil -0.0 -> -0 174ceil10020 ceil 1e-200 -> 1 175ceil10021 ceil -1e-200 -> -0 176ceil10022 ceil 0.5 -> 1 177ceil10023 ceil -0.5 -> -0 178ceil10024 ceil 0.999999999999 -> 1 179ceil10025 ceil -0.99999999999 -> -0 180ceil10026 ceil -1.0 -> -1 181ceil10027 ceil 1.0 -> 1 182ceil10028 ceil 9.9 -> 10 183ceil10029 ceil -9.9 -> -9 184ceil10030 ceil 9.333e+80 -> 9.333E+80 185ceil10031 ceil -9.333e+80 -> -9.333E+80 186ceil10032 ceil 100.0 -> 100 187ceil10033 ceil -100.0 -> -100 188trunc10034 trunc 0 -> 0 189trunc10035 trunc 0.0 -> 0 190trunc10036 trunc -0.0 -> -0 191trunc10037 trunc 1e-200 -> 0 192trunc10038 trunc -1e-200 -> -0 193trunc10039 trunc 0.5 -> 0 194trunc10040 trunc -0.5 -> -0 195trunc10041 trunc 0.999999999999 -> 0 196trunc10042 trunc -0.99999999999 -> -0 197trunc10043 trunc -1.0 -> -1 198trunc10044 trunc 1.0 -> 1 199trunc10045 trunc 9.9 -> 9 200trunc10046 trunc -9.9 -> -9 201trunc10047 trunc 9.333e+80 -> 9.333E+80 202trunc10048 trunc -9.333e+80 -> -9.333E+80 203trunc10049 trunc 100.0 -> 100 204trunc10050 trunc -100.0 -> -100 205 206-- negative etop: trigger allocation failure in mpd_qshiftl. 207maxexponent: 50 208minexponent: -50 209precision: 100 210clamp: 1 211etop10051 apply 1e+50 -> 100000000000000000000000000000000000000000000000000.0000000000000000000000000000000000000000000000000 Clamped 212 213-- test mpd_qln10(). 214 215lnX10052 ln10 1 -> 2 Rounded Inexact 216lnX10053 ln10 51 -> 2.30258509299404568401799145468436420760110148862877 Rounded Inexact 217lnX10054 ln10 101 -> 2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983 Rounded Inexact 218 219precision: 4 220rounding: floor 221maxExponent: 4 222minExponent: -4 223clamp: 0 224 225covx10101 divide 99960 -8.4E+2 -> -119.0 226 227-- ExtendedRange==0 disables the allcr=0 tests. 228 229ExtendedRange: 0 230 231Precision: 119 232MaxExponent: 425000000 233MinExponent: -425000000 234Rounding: Half_even 235Clamp: 0 236gen14398 exp '-978598892.4783936221181690860' -> '1.0000000000000000000E-425000099' Inexact Rounded Subnormal Underflow 237 238precision: 21 239MaxExponent: 2100 240MinExponent: -2100 241 242expx10001: exp -4835.428695287495936437782054837164835962313126120423249669988592031902480322440208495594130688156427 -> 1.00000000000000000000E-2100 Rounded Inexact Subnormal Underflow 243 244precision: 21 245rounding: Up 246MaxExponent: 2100 247MinExponent: -55 248clamp: 0 249 250lnx10001 ln 1.0000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000025 -> 1.00000000000000000000E-55 Rounded Inexact Subnormal Underflow 251 252precision: 43 253rounding: Up 254MaxExponent: 784 255MinExponent: -101 256clamp: 1 257 258lnx10002 ln 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 -> 1.000000000000000000000000000000000000000000E-101 Rounded Inexact 259 260precision: 7 261rounding: Up 262MaxExponent: 96 263MinExponent: -95 264clamp: 1 265 266lnx10003 ln 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005 -> 5E-101 Rounded Inexact Subnormal Underflow 267 268precision: 21 269rounding: Up 270MaxExponent: 2100 271MinExponent: -55 272clamp: 0 273 274log10x10001 log10 1.000000000000000000000000000000000000000000000000000000230258509299404568401799145468436420760110149 -> 1.00000000000000000000E-55 Rounded Inexact 275 276-- Restore ExtendedRange because it is a global variable in the C tests. 277ExtendedRange: 1 278