1------------------------------------------------------------------------ 2-- dqRotate.decTest -- rotate decQuad coefficient left or right -- 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 22extended: 1 23clamp: 1 24precision: 34 25maxExponent: 6144 26minExponent: -6143 27rounding: half_even 28 29-- Sanity check 30dqrot001 rotate 0 0 -> 0 31dqrot002 rotate 0 2 -> 0 32dqrot003 rotate 1 2 -> 100 33dqrot004 rotate 1 33 -> 1000000000000000000000000000000000 34dqrot005 rotate 1 34 -> 1 35dqrot006 rotate 1 -1 -> 1000000000000000000000000000000000 36dqrot007 rotate 0 -2 -> 0 37dqrot008 rotate 1234567890123456789012345678901234 -1 -> 4123456789012345678901234567890123 38dqrot009 rotate 1234567890123456789012345678901234 -33 -> 2345678901234567890123456789012341 39dqrot010 rotate 1234567890123456789012345678901234 -34 -> 1234567890123456789012345678901234 40dqrot011 rotate 9934567890123456789012345678901234 -33 -> 9345678901234567890123456789012349 41dqrot012 rotate 9934567890123456789012345678901234 -34 -> 9934567890123456789012345678901234 42 43-- rhs must be an integer 44dqrot015 rotate 1 1.5 -> NaN Invalid_operation 45dqrot016 rotate 1 1.0 -> NaN Invalid_operation 46dqrot017 rotate 1 0.1 -> NaN Invalid_operation 47dqrot018 rotate 1 0.0 -> NaN Invalid_operation 48dqrot019 rotate 1 1E+1 -> NaN Invalid_operation 49dqrot020 rotate 1 1E+99 -> NaN Invalid_operation 50dqrot021 rotate 1 Inf -> NaN Invalid_operation 51dqrot022 rotate 1 -Inf -> NaN Invalid_operation 52-- and |rhs| <= precision 53dqrot025 rotate 1 -1000 -> NaN Invalid_operation 54dqrot026 rotate 1 -35 -> NaN Invalid_operation 55dqrot027 rotate 1 35 -> NaN Invalid_operation 56dqrot028 rotate 1 1000 -> NaN Invalid_operation 57 58-- full pattern 59dqrot030 rotate 1234567890123456789012345678901234 -34 -> 1234567890123456789012345678901234 60dqrot031 rotate 1234567890123456789012345678901234 -33 -> 2345678901234567890123456789012341 61dqrot032 rotate 1234567890123456789012345678901234 -32 -> 3456789012345678901234567890123412 62dqrot033 rotate 1234567890123456789012345678901234 -31 -> 4567890123456789012345678901234123 63dqrot034 rotate 1234567890123456789012345678901234 -30 -> 5678901234567890123456789012341234 64dqrot035 rotate 1234567890123456789012345678901234 -29 -> 6789012345678901234567890123412345 65dqrot036 rotate 1234567890123456789012345678901234 -28 -> 7890123456789012345678901234123456 66dqrot037 rotate 1234567890123456789012345678901234 -27 -> 8901234567890123456789012341234567 67dqrot038 rotate 1234567890123456789012345678901234 -26 -> 9012345678901234567890123412345678 68dqrot039 rotate 1234567890123456789012345678901234 -25 -> 123456789012345678901234123456789 69dqrot040 rotate 1234567890123456789012345678901234 -24 -> 1234567890123456789012341234567890 70dqrot041 rotate 1234567890123456789012345678901234 -23 -> 2345678901234567890123412345678901 71dqrot042 rotate 1234567890123456789012345678901234 -22 -> 3456789012345678901234123456789012 72dqrot043 rotate 1234567890123456789012345678901234 -21 -> 4567890123456789012341234567890123 73dqrot044 rotate 1234567890123456789012345678901234 -20 -> 5678901234567890123412345678901234 74dqrot045 rotate 1234567890123456789012345678901234 -19 -> 6789012345678901234123456789012345 75dqrot047 rotate 1234567890123456789012345678901234 -18 -> 7890123456789012341234567890123456 76dqrot048 rotate 1234567890123456789012345678901234 -17 -> 8901234567890123412345678901234567 77dqrot049 rotate 1234567890123456789012345678901234 -16 -> 9012345678901234123456789012345678 78dqrot050 rotate 1234567890123456789012345678901234 -15 -> 123456789012341234567890123456789 79dqrot051 rotate 1234567890123456789012345678901234 -14 -> 1234567890123412345678901234567890 80dqrot052 rotate 1234567890123456789012345678901234 -13 -> 2345678901234123456789012345678901 81dqrot053 rotate 1234567890123456789012345678901234 -12 -> 3456789012341234567890123456789012 82dqrot054 rotate 1234567890123456789012345678901234 -11 -> 4567890123412345678901234567890123 83dqrot055 rotate 1234567890123456789012345678901234 -10 -> 5678901234123456789012345678901234 84dqrot056 rotate 1234567890123456789012345678901234 -9 -> 6789012341234567890123456789012345 85dqrot057 rotate 1234567890123456789012345678901234 -8 -> 7890123412345678901234567890123456 86dqrot058 rotate 1234567890123456789012345678901234 -7 -> 8901234123456789012345678901234567 87dqrot059 rotate 1234567890123456789012345678901234 -6 -> 9012341234567890123456789012345678 88dqrot060 rotate 1234567890123456789012345678901234 -5 -> 123412345678901234567890123456789 89dqrot061 rotate 1234567890123456789012345678901234 -4 -> 1234123456789012345678901234567890 90dqrot062 rotate 1234567890123456789012345678901234 -3 -> 2341234567890123456789012345678901 91dqrot063 rotate 1234567890123456789012345678901234 -2 -> 3412345678901234567890123456789012 92dqrot064 rotate 1234567890123456789012345678901234 -1 -> 4123456789012345678901234567890123 93dqrot065 rotate 1234567890123456789012345678901234 -0 -> 1234567890123456789012345678901234 94 95dqrot066 rotate 1234567890123456789012345678901234 +0 -> 1234567890123456789012345678901234 96dqrot067 rotate 1234567890123456789012345678901234 +1 -> 2345678901234567890123456789012341 97dqrot068 rotate 1234567890123456789012345678901234 +2 -> 3456789012345678901234567890123412 98dqrot069 rotate 1234567890123456789012345678901234 +3 -> 4567890123456789012345678901234123 99dqrot070 rotate 1234567890123456789012345678901234 +4 -> 5678901234567890123456789012341234 100dqrot071 rotate 1234567890123456789012345678901234 +5 -> 6789012345678901234567890123412345 101dqrot072 rotate 1234567890123456789012345678901234 +6 -> 7890123456789012345678901234123456 102dqrot073 rotate 1234567890123456789012345678901234 +7 -> 8901234567890123456789012341234567 103dqrot074 rotate 1234567890123456789012345678901234 +8 -> 9012345678901234567890123412345678 104dqrot075 rotate 1234567890123456789012345678901234 +9 -> 123456789012345678901234123456789 105dqrot076 rotate 1234567890123456789012345678901234 +10 -> 1234567890123456789012341234567890 106dqrot077 rotate 1234567890123456789012345678901234 +11 -> 2345678901234567890123412345678901 107dqrot078 rotate 1234567890123456789012345678901234 +12 -> 3456789012345678901234123456789012 108dqrot079 rotate 1234567890123456789012345678901234 +13 -> 4567890123456789012341234567890123 109dqrot080 rotate 1234567890123456789012345678901234 +14 -> 5678901234567890123412345678901234 110dqrot081 rotate 1234567890123456789012345678901234 +15 -> 6789012345678901234123456789012345 111dqrot082 rotate 1234567890123456789012345678901234 +16 -> 7890123456789012341234567890123456 112dqrot083 rotate 1234567890123456789012345678901234 +17 -> 8901234567890123412345678901234567 113dqrot084 rotate 1234567890123456789012345678901234 +18 -> 9012345678901234123456789012345678 114dqrot085 rotate 1234567890123456789012345678901234 +19 -> 123456789012341234567890123456789 115dqrot086 rotate 1234567890123456789012345678901234 +20 -> 1234567890123412345678901234567890 116dqrot087 rotate 1234567890123456789012345678901234 +21 -> 2345678901234123456789012345678901 117dqrot088 rotate 1234567890123456789012345678901234 +22 -> 3456789012341234567890123456789012 118dqrot089 rotate 1234567890123456789012345678901234 +23 -> 4567890123412345678901234567890123 119dqrot090 rotate 1234567890123456789012345678901234 +24 -> 5678901234123456789012345678901234 120dqrot091 rotate 1234567890123456789012345678901234 +25 -> 6789012341234567890123456789012345 121dqrot092 rotate 1234567890123456789012345678901234 +26 -> 7890123412345678901234567890123456 122dqrot093 rotate 1234567890123456789012345678901234 +27 -> 8901234123456789012345678901234567 123dqrot094 rotate 1234567890123456789012345678901234 +28 -> 9012341234567890123456789012345678 124dqrot095 rotate 1234567890123456789012345678901234 +29 -> 123412345678901234567890123456789 125dqrot096 rotate 1234567890123456789012345678901234 +30 -> 1234123456789012345678901234567890 126dqrot097 rotate 1234567890123456789012345678901234 +31 -> 2341234567890123456789012345678901 127dqrot098 rotate 1234567890123456789012345678901234 +32 -> 3412345678901234567890123456789012 128dqrot099 rotate 1234567890123456789012345678901234 +33 -> 4123456789012345678901234567890123 129dqrot100 rotate 1234567890123456789012345678901234 +34 -> 1234567890123456789012345678901234 130 131-- zeros 132dqrot270 rotate 0E-10 +29 -> 0E-10 133dqrot271 rotate 0E-10 -29 -> 0E-10 134dqrot272 rotate 0.000 +29 -> 0.000 135dqrot273 rotate 0.000 -29 -> 0.000 136dqrot274 rotate 0E+10 +29 -> 0E+10 137dqrot275 rotate 0E+10 -29 -> 0E+10 138dqrot276 rotate -0E-10 +29 -> -0E-10 139dqrot277 rotate -0E-10 -29 -> -0E-10 140dqrot278 rotate -0.000 +29 -> -0.000 141dqrot279 rotate -0.000 -29 -> -0.000 142dqrot280 rotate -0E+10 +29 -> -0E+10 143dqrot281 rotate -0E+10 -29 -> -0E+10 144 145-- Nmax, Nmin, Ntiny 146dqrot141 rotate 9.999999999999999999999999999999999E+6144 -1 -> 9.999999999999999999999999999999999E+6144 147dqrot142 rotate 9.999999999999999999999999999999999E+6144 -33 -> 9.999999999999999999999999999999999E+6144 148dqrot143 rotate 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999999E+6144 149dqrot144 rotate 9.999999999999999999999999999999999E+6144 33 -> 9.999999999999999999999999999999999E+6144 150dqrot145 rotate 1E-6143 -1 -> 1.000000000000000000000000000000000E-6110 151dqrot146 rotate 1E-6143 -33 -> 1.0E-6142 152dqrot147 rotate 1E-6143 1 -> 1.0E-6142 153dqrot148 rotate 1E-6143 33 -> 1.000000000000000000000000000000000E-6110 154dqrot151 rotate 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144 155dqrot152 rotate 1.000000000000000000000000000000000E-6143 -33 -> 1E-6176 156dqrot153 rotate 1.000000000000000000000000000000000E-6143 1 -> 1E-6176 157dqrot154 rotate 1.000000000000000000000000000000000E-6143 33 -> 1.00000000000000000000000000000000E-6144 158dqrot155 rotate 9.000000000000000000000000000000000E-6143 -1 -> 9.00000000000000000000000000000000E-6144 159dqrot156 rotate 9.000000000000000000000000000000000E-6143 -33 -> 9E-6176 160dqrot157 rotate 9.000000000000000000000000000000000E-6143 1 -> 9E-6176 161dqrot158 rotate 9.000000000000000000000000000000000E-6143 33 -> 9.00000000000000000000000000000000E-6144 162dqrot160 rotate 1E-6176 -1 -> 1.000000000000000000000000000000000E-6143 163dqrot161 rotate 1E-6176 -33 -> 1.0E-6175 164dqrot162 rotate 1E-6176 1 -> 1.0E-6175 165dqrot163 rotate 1E-6176 33 -> 1.000000000000000000000000000000000E-6143 166-- negatives 167dqrot171 rotate -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144 168dqrot172 rotate -9.999999999999999999999999999999999E+6144 -33 -> -9.999999999999999999999999999999999E+6144 169dqrot173 rotate -9.999999999999999999999999999999999E+6144 1 -> -9.999999999999999999999999999999999E+6144 170dqrot174 rotate -9.999999999999999999999999999999999E+6144 33 -> -9.999999999999999999999999999999999E+6144 171dqrot175 rotate -1E-6143 -1 -> -1.000000000000000000000000000000000E-6110 172dqrot176 rotate -1E-6143 -33 -> -1.0E-6142 173dqrot177 rotate -1E-6143 1 -> -1.0E-6142 174dqrot178 rotate -1E-6143 33 -> -1.000000000000000000000000000000000E-6110 175dqrot181 rotate -1.000000000000000000000000000000000E-6143 -1 -> -1.00000000000000000000000000000000E-6144 176dqrot182 rotate -1.000000000000000000000000000000000E-6143 -33 -> -1E-6176 177dqrot183 rotate -1.000000000000000000000000000000000E-6143 1 -> -1E-6176 178dqrot184 rotate -1.000000000000000000000000000000000E-6143 33 -> -1.00000000000000000000000000000000E-6144 179dqrot185 rotate -9.000000000000000000000000000000000E-6143 -1 -> -9.00000000000000000000000000000000E-6144 180dqrot186 rotate -9.000000000000000000000000000000000E-6143 -33 -> -9E-6176 181dqrot187 rotate -9.000000000000000000000000000000000E-6143 1 -> -9E-6176 182dqrot188 rotate -9.000000000000000000000000000000000E-6143 33 -> -9.00000000000000000000000000000000E-6144 183dqrot190 rotate -1E-6176 -1 -> -1.000000000000000000000000000000000E-6143 184dqrot191 rotate -1E-6176 -33 -> -1.0E-6175 185dqrot192 rotate -1E-6176 1 -> -1.0E-6175 186dqrot193 rotate -1E-6176 33 -> -1.000000000000000000000000000000000E-6143 187 188-- more negatives (of sanities) 189dqrot201 rotate -0 0 -> -0 190dqrot202 rotate -0 2 -> -0 191dqrot203 rotate -1 2 -> -100 192dqrot204 rotate -1 33 -> -1000000000000000000000000000000000 193dqrot205 rotate -1 34 -> -1 194dqrot206 rotate -1 -1 -> -1000000000000000000000000000000000 195dqrot207 rotate -0 -2 -> -0 196dqrot208 rotate -1234567890123456789012345678901234 -1 -> -4123456789012345678901234567890123 197dqrot209 rotate -1234567890123456789012345678901234 -33 -> -2345678901234567890123456789012341 198dqrot210 rotate -1234567890123456789012345678901234 -34 -> -1234567890123456789012345678901234 199dqrot211 rotate -9934567890123456789012345678901234 -33 -> -9345678901234567890123456789012349 200dqrot212 rotate -9934567890123456789012345678901234 -34 -> -9934567890123456789012345678901234 201 202 203-- Specials; NaNs are handled as usual 204dqrot781 rotate -Inf -8 -> -Infinity 205dqrot782 rotate -Inf -1 -> -Infinity 206dqrot783 rotate -Inf -0 -> -Infinity 207dqrot784 rotate -Inf 0 -> -Infinity 208dqrot785 rotate -Inf 1 -> -Infinity 209dqrot786 rotate -Inf 8 -> -Infinity 210dqrot787 rotate -1000 -Inf -> NaN Invalid_operation 211dqrot788 rotate -Inf -Inf -> NaN Invalid_operation 212dqrot789 rotate -1 -Inf -> NaN Invalid_operation 213dqrot790 rotate -0 -Inf -> NaN Invalid_operation 214dqrot791 rotate 0 -Inf -> NaN Invalid_operation 215dqrot792 rotate 1 -Inf -> NaN Invalid_operation 216dqrot793 rotate 1000 -Inf -> NaN Invalid_operation 217dqrot794 rotate Inf -Inf -> NaN Invalid_operation 218 219dqrot800 rotate Inf -Inf -> NaN Invalid_operation 220dqrot801 rotate Inf -8 -> Infinity 221dqrot802 rotate Inf -1 -> Infinity 222dqrot803 rotate Inf -0 -> Infinity 223dqrot804 rotate Inf 0 -> Infinity 224dqrot805 rotate Inf 1 -> Infinity 225dqrot806 rotate Inf 8 -> Infinity 226dqrot807 rotate Inf Inf -> NaN Invalid_operation 227dqrot808 rotate -1000 Inf -> NaN Invalid_operation 228dqrot809 rotate -Inf Inf -> NaN Invalid_operation 229dqrot810 rotate -1 Inf -> NaN Invalid_operation 230dqrot811 rotate -0 Inf -> NaN Invalid_operation 231dqrot812 rotate 0 Inf -> NaN Invalid_operation 232dqrot813 rotate 1 Inf -> NaN Invalid_operation 233dqrot814 rotate 1000 Inf -> NaN Invalid_operation 234dqrot815 rotate Inf Inf -> NaN Invalid_operation 235 236dqrot821 rotate NaN -Inf -> NaN 237dqrot822 rotate NaN -1000 -> NaN 238dqrot823 rotate NaN -1 -> NaN 239dqrot824 rotate NaN -0 -> NaN 240dqrot825 rotate NaN 0 -> NaN 241dqrot826 rotate NaN 1 -> NaN 242dqrot827 rotate NaN 1000 -> NaN 243dqrot828 rotate NaN Inf -> NaN 244dqrot829 rotate NaN NaN -> NaN 245dqrot830 rotate -Inf NaN -> NaN 246dqrot831 rotate -1000 NaN -> NaN 247dqrot832 rotate -1 NaN -> NaN 248dqrot833 rotate -0 NaN -> NaN 249dqrot834 rotate 0 NaN -> NaN 250dqrot835 rotate 1 NaN -> NaN 251dqrot836 rotate 1000 NaN -> NaN 252dqrot837 rotate Inf NaN -> NaN 253 254dqrot841 rotate sNaN -Inf -> NaN Invalid_operation 255dqrot842 rotate sNaN -1000 -> NaN Invalid_operation 256dqrot843 rotate sNaN -1 -> NaN Invalid_operation 257dqrot844 rotate sNaN -0 -> NaN Invalid_operation 258dqrot845 rotate sNaN 0 -> NaN Invalid_operation 259dqrot846 rotate sNaN 1 -> NaN Invalid_operation 260dqrot847 rotate sNaN 1000 -> NaN Invalid_operation 261dqrot848 rotate sNaN NaN -> NaN Invalid_operation 262dqrot849 rotate sNaN sNaN -> NaN Invalid_operation 263dqrot850 rotate NaN sNaN -> NaN Invalid_operation 264dqrot851 rotate -Inf sNaN -> NaN Invalid_operation 265dqrot852 rotate -1000 sNaN -> NaN Invalid_operation 266dqrot853 rotate -1 sNaN -> NaN Invalid_operation 267dqrot854 rotate -0 sNaN -> NaN Invalid_operation 268dqrot855 rotate 0 sNaN -> NaN Invalid_operation 269dqrot856 rotate 1 sNaN -> NaN Invalid_operation 270dqrot857 rotate 1000 sNaN -> NaN Invalid_operation 271dqrot858 rotate Inf sNaN -> NaN Invalid_operation 272dqrot859 rotate NaN sNaN -> NaN Invalid_operation 273 274-- propagating NaNs 275dqrot861 rotate NaN1 -Inf -> NaN1 276dqrot862 rotate +NaN2 -1000 -> NaN2 277dqrot863 rotate NaN3 1000 -> NaN3 278dqrot864 rotate NaN4 Inf -> NaN4 279dqrot865 rotate NaN5 +NaN6 -> NaN5 280dqrot866 rotate -Inf NaN7 -> NaN7 281dqrot867 rotate -1000 NaN8 -> NaN8 282dqrot868 rotate 1000 NaN9 -> NaN9 283dqrot869 rotate Inf +NaN10 -> NaN10 284dqrot871 rotate sNaN11 -Inf -> NaN11 Invalid_operation 285dqrot872 rotate sNaN12 -1000 -> NaN12 Invalid_operation 286dqrot873 rotate sNaN13 1000 -> NaN13 Invalid_operation 287dqrot874 rotate sNaN14 NaN17 -> NaN14 Invalid_operation 288dqrot875 rotate sNaN15 sNaN18 -> NaN15 Invalid_operation 289dqrot876 rotate NaN16 sNaN19 -> NaN19 Invalid_operation 290dqrot877 rotate -Inf +sNaN20 -> NaN20 Invalid_operation 291dqrot878 rotate -1000 sNaN21 -> NaN21 Invalid_operation 292dqrot879 rotate 1000 sNaN22 -> NaN22 Invalid_operation 293dqrot880 rotate Inf sNaN23 -> NaN23 Invalid_operation 294dqrot881 rotate +NaN25 +sNaN24 -> NaN24 Invalid_operation 295dqrot882 rotate -NaN26 NaN28 -> -NaN26 296dqrot883 rotate -sNaN27 sNaN29 -> -NaN27 Invalid_operation 297dqrot884 rotate 1000 -NaN30 -> -NaN30 298dqrot885 rotate 1000 -sNaN31 -> -NaN31 Invalid_operation 299