1 ------------------------------------------------------------------------ 2 -- dqLogB.decTest -- integral 754r adjusted exponent, for decQuads -- 3 -- Copyright (c) IBM Corporation, 2005, 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 extended: 1 23 clamp: 1 24 precision: 34 25 maxExponent: 6144 26 minExponent: -6143 27 rounding: half_even 28 29 -- basics 30 dqlogb000 logb 0 -> -Infinity Division_by_zero 31 dqlogb001 logb 1E-6176 -> -6176 32 dqlogb002 logb 1E-6143 -> -6143 33 dqlogb003 logb 0.001 -> -3 34 dqlogb004 logb 0.03 -> -2 35 dqlogb005 logb 1 -> 0 36 dqlogb006 logb 2 -> 0 37 dqlogb007 logb 2.5 -> 0 38 dqlogb008 logb 2.50 -> 0 39 dqlogb009 logb 2.500 -> 0 40 dqlogb010 logb 10 -> 1 41 dqlogb011 logb 70 -> 1 42 dqlogb012 logb 100 -> 2 43 dqlogb013 logb 250 -> 2 44 dqlogb014 logb 9E+6144 -> 6144 45 dqlogb015 logb +Infinity -> Infinity 46 47 -- negatives appear to be treated as positives 48 dqlogb021 logb -0 -> -Infinity Division_by_zero 49 dqlogb022 logb -1E-6176 -> -6176 50 dqlogb023 logb -9E-6143 -> -6143 51 dqlogb024 logb -0.001 -> -3 52 dqlogb025 logb -1 -> 0 53 dqlogb026 logb -2 -> 0 54 dqlogb027 logb -10 -> 1 55 dqlogb028 logb -70 -> 1 56 dqlogb029 logb -100 -> 2 57 dqlogb030 logb -9E+6144 -> 6144 58 dqlogb031 logb -Infinity -> Infinity 59 60 -- zeros 61 dqlogb111 logb 0 -> -Infinity Division_by_zero 62 dqlogb112 logb -0 -> -Infinity Division_by_zero 63 dqlogb113 logb 0E+4 -> -Infinity Division_by_zero 64 dqlogb114 logb -0E+4 -> -Infinity Division_by_zero 65 dqlogb115 logb 0.0000 -> -Infinity Division_by_zero 66 dqlogb116 logb -0.0000 -> -Infinity Division_by_zero 67 dqlogb117 logb 0E-141 -> -Infinity Division_by_zero 68 dqlogb118 logb -0E-141 -> -Infinity Division_by_zero 69 70 -- full coefficients, alternating bits 71 dqlogb121 logb 268268268 -> 8 72 dqlogb122 logb -268268268 -> 8 73 dqlogb123 logb 134134134 -> 8 74 dqlogb124 logb -134134134 -> 8 75 76 -- Nmax, Nmin, Ntiny 77 dqlogb131 logb 9.999999999999999999999999999999999E+6144 -> 6144 78 dqlogb132 logb 1E-6143 -> -6143 79 dqlogb133 logb 1.000000000000000000000000000000000E-6143 -> -6143 80 dqlogb134 logb 1E-6176 -> -6176 81 82 dqlogb135 logb -1E-6176 -> -6176 83 dqlogb136 logb -1.000000000000000000000000000000000E-6143 -> -6143 84 dqlogb137 logb -1E-6143 -> -6143 85 dqlogb1614 logb -9.999999999999999999999999999999999E+6144 -> 6144 86 87 -- ones 88 dqlogb0061 logb 1 -> 0 89 dqlogb0062 logb 1.0 -> 0 90 dqlogb0063 logb 1.000000000000000 -> 0 91 92 -- notable cases -- exact powers of 10 93 dqlogb1100 logb 1 -> 0 94 dqlogb1101 logb 10 -> 1 95 dqlogb1102 logb 100 -> 2 96 dqlogb1103 logb 1000 -> 3 97 dqlogb1104 logb 10000 -> 4 98 dqlogb1105 logb 100000 -> 5 99 dqlogb1106 logb 1000000 -> 6 100 dqlogb1107 logb 10000000 -> 7 101 dqlogb1108 logb 100000000 -> 8 102 dqlogb1109 logb 1000000000 -> 9 103 dqlogb1110 logb 10000000000 -> 10 104 dqlogb1111 logb 100000000000 -> 11 105 dqlogb1112 logb 1000000000000 -> 12 106 dqlogb1113 logb 0.00000000001 -> -11 107 dqlogb1114 logb 0.0000000001 -> -10 108 dqlogb1115 logb 0.000000001 -> -9 109 dqlogb1116 logb 0.00000001 -> -8 110 dqlogb1117 logb 0.0000001 -> -7 111 dqlogb1118 logb 0.000001 -> -6 112 dqlogb1119 logb 0.00001 -> -5 113 dqlogb1120 logb 0.0001 -> -4 114 dqlogb1121 logb 0.001 -> -3 115 dqlogb1122 logb 0.01 -> -2 116 dqlogb1123 logb 0.1 -> -1 117 dqlogb1124 logb 1E-99 -> -99 118 dqlogb1125 logb 1E-100 -> -100 119 dqlogb1127 logb 1E-299 -> -299 120 dqlogb1126 logb 1E-6143 -> -6143 121 122 -- suggestions from Ilan Nehama 123 dqlogb1400 logb 10E-3 -> -2 124 dqlogb1401 logb 10E-2 -> -1 125 dqlogb1402 logb 100E-2 -> 0 126 dqlogb1403 logb 1000E-2 -> 1 127 dqlogb1404 logb 10000E-2 -> 2 128 dqlogb1405 logb 10E-1 -> 0 129 dqlogb1406 logb 100E-1 -> 1 130 dqlogb1407 logb 1000E-1 -> 2 131 dqlogb1408 logb 10000E-1 -> 3 132 dqlogb1409 logb 10E0 -> 1 133 dqlogb1410 logb 100E0 -> 2 134 dqlogb1411 logb 1000E0 -> 3 135 dqlogb1412 logb 10000E0 -> 4 136 dqlogb1413 logb 10E1 -> 2 137 dqlogb1414 logb 100E1 -> 3 138 dqlogb1415 logb 1000E1 -> 4 139 dqlogb1416 logb 10000E1 -> 5 140 dqlogb1417 logb 10E2 -> 3 141 dqlogb1418 logb 100E2 -> 4 142 dqlogb1419 logb 1000E2 -> 5 143 dqlogb1420 logb 10000E2 -> 6 144 145 -- special values 146 dqlogb820 logb Infinity -> Infinity 147 dqlogb821 logb 0 -> -Infinity Division_by_zero 148 dqlogb822 logb NaN -> NaN 149 dqlogb823 logb sNaN -> NaN Invalid_operation 150 -- propagating NaNs 151 dqlogb824 logb sNaN123 -> NaN123 Invalid_operation 152 dqlogb825 logb -sNaN321 -> -NaN321 Invalid_operation 153 dqlogb826 logb NaN456 -> NaN456 154 dqlogb827 logb -NaN654 -> -NaN654 155 dqlogb828 logb NaN1 -> NaN1 156 157 -- Null test 158 dqlogb900 logb # -> NaN Invalid_operation 159 160 161