]>
Commit | Line | Data |
---|---|---|
4710c53d | 1 | ------------------------------------------------------------------------\r |
2 | -- rotate.decTest -- rotate coefficient left or right --\r | |
3 | -- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --\r | |
4 | ------------------------------------------------------------------------\r | |
5 | -- Please see the document "General Decimal Arithmetic Testcases" --\r | |
6 | -- at http://www2.hursley.ibm.com/decimal for the description of --\r | |
7 | -- these testcases. --\r | |
8 | -- --\r | |
9 | -- These testcases are experimental ('beta' versions), and they --\r | |
10 | -- may contain errors. They are offered on an as-is basis. In --\r | |
11 | -- particular, achieving the same results as the tests here is not --\r | |
12 | -- a guarantee that an implementation complies with any Standard --\r | |
13 | -- or specification. The tests are not exhaustive. --\r | |
14 | -- --\r | |
15 | -- Please send comments, suggestions, and corrections to the author: --\r | |
16 | -- Mike Cowlishaw, IBM Fellow --\r | |
17 | -- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --\r | |
18 | -- mfc@uk.ibm.com --\r | |
19 | ------------------------------------------------------------------------\r | |
20 | version: 2.59\r | |
21 | \r | |
22 | extended: 1\r | |
23 | precision: 9\r | |
24 | rounding: half_up\r | |
25 | maxExponent: 999\r | |
26 | minExponent: -999\r | |
27 | \r | |
28 | -- Sanity check\r | |
29 | rotx001 rotate 0 0 -> 0\r | |
30 | rotx002 rotate 0 2 -> 0\r | |
31 | rotx003 rotate 1 2 -> 100\r | |
32 | rotx004 rotate 34 8 -> 400000003\r | |
33 | rotx005 rotate 1 9 -> 1\r | |
34 | rotx006 rotate 1 -1 -> 100000000\r | |
35 | rotx007 rotate 123456789 -1 -> 912345678\r | |
36 | rotx008 rotate 123456789 -8 -> 234567891\r | |
37 | rotx009 rotate 123456789 -9 -> 123456789\r | |
38 | rotx010 rotate 0 -2 -> 0\r | |
39 | \r | |
40 | -- rhs must be an integer\r | |
41 | rotx011 rotate 1 1.5 -> NaN Invalid_operation\r | |
42 | rotx012 rotate 1 1.0 -> NaN Invalid_operation\r | |
43 | rotx013 rotate 1 0.1 -> NaN Invalid_operation\r | |
44 | rotx014 rotate 1 0.0 -> NaN Invalid_operation\r | |
45 | rotx015 rotate 1 1E+1 -> NaN Invalid_operation\r | |
46 | rotx016 rotate 1 1E+99 -> NaN Invalid_operation\r | |
47 | rotx017 rotate 1 Inf -> NaN Invalid_operation\r | |
48 | rotx018 rotate 1 -Inf -> NaN Invalid_operation\r | |
49 | -- and |rhs| <= precision\r | |
50 | rotx020 rotate 1 -1000 -> NaN Invalid_operation\r | |
51 | rotx021 rotate 1 -10 -> NaN Invalid_operation\r | |
52 | rotx022 rotate 1 10 -> NaN Invalid_operation\r | |
53 | rotx023 rotate 1 1000 -> NaN Invalid_operation\r | |
54 | \r | |
55 | -- full pattern\r | |
56 | rotx030 rotate 123456789 -9 -> 123456789\r | |
57 | rotx031 rotate 123456789 -8 -> 234567891\r | |
58 | rotx032 rotate 123456789 -7 -> 345678912\r | |
59 | rotx033 rotate 123456789 -6 -> 456789123\r | |
60 | rotx034 rotate 123456789 -5 -> 567891234\r | |
61 | rotx035 rotate 123456789 -4 -> 678912345\r | |
62 | rotx036 rotate 123456789 -3 -> 789123456\r | |
63 | rotx037 rotate 123456789 -2 -> 891234567\r | |
64 | rotx038 rotate 123456789 -1 -> 912345678\r | |
65 | rotx039 rotate 123456789 -0 -> 123456789\r | |
66 | rotx040 rotate 123456789 +0 -> 123456789\r | |
67 | rotx041 rotate 123456789 +1 -> 234567891\r | |
68 | rotx042 rotate 123456789 +2 -> 345678912\r | |
69 | rotx043 rotate 123456789 +3 -> 456789123\r | |
70 | rotx044 rotate 123456789 +4 -> 567891234\r | |
71 | rotx045 rotate 123456789 +5 -> 678912345\r | |
72 | rotx046 rotate 123456789 +6 -> 789123456\r | |
73 | rotx047 rotate 123456789 +7 -> 891234567\r | |
74 | rotx048 rotate 123456789 +8 -> 912345678\r | |
75 | rotx049 rotate 123456789 +9 -> 123456789\r | |
76 | \r | |
77 | -- zeros\r | |
78 | rotx060 rotate 0E-10 +9 -> 0E-10\r | |
79 | rotx061 rotate 0E-10 -9 -> 0E-10\r | |
80 | rotx062 rotate 0.000 +9 -> 0.000\r | |
81 | rotx063 rotate 0.000 -9 -> 0.000\r | |
82 | rotx064 rotate 0E+10 +9 -> 0E+10\r | |
83 | rotx065 rotate 0E+10 -9 -> 0E+10\r | |
84 | rotx066 rotate -0E-10 +9 -> -0E-10\r | |
85 | rotx067 rotate -0E-10 -9 -> -0E-10\r | |
86 | rotx068 rotate -0.000 +9 -> -0.000\r | |
87 | rotx069 rotate -0.000 -9 -> -0.000\r | |
88 | rotx070 rotate -0E+10 +9 -> -0E+10\r | |
89 | rotx071 rotate -0E+10 -9 -> -0E+10\r | |
90 | \r | |
91 | -- Nmax, Nmin, Ntiny\r | |
92 | rotx141 rotate 9.99999999E+999 -1 -> 9.99999999E+999\r | |
93 | rotx142 rotate 9.99999999E+999 -8 -> 9.99999999E+999\r | |
94 | rotx143 rotate 9.99999999E+999 1 -> 9.99999999E+999\r | |
95 | rotx144 rotate 9.99999999E+999 8 -> 9.99999999E+999\r | |
96 | rotx145 rotate 1E-999 -1 -> 1.00000000E-991\r | |
97 | rotx146 rotate 1E-999 -8 -> 1.0E-998\r | |
98 | rotx147 rotate 1E-999 1 -> 1.0E-998\r | |
99 | rotx148 rotate 1E-999 8 -> 1.00000000E-991\r | |
100 | rotx151 rotate 1.00000000E-999 -1 -> 1.0000000E-1000\r | |
101 | rotx152 rotate 1.00000000E-999 -8 -> 1E-1007\r | |
102 | rotx153 rotate 1.00000000E-999 1 -> 1E-1007\r | |
103 | rotx154 rotate 1.00000000E-999 8 -> 1.0000000E-1000\r | |
104 | rotx155 rotate 9.00000000E-999 -1 -> 9.0000000E-1000\r | |
105 | rotx156 rotate 9.00000000E-999 -8 -> 9E-1007\r | |
106 | rotx157 rotate 9.00000000E-999 1 -> 9E-1007\r | |
107 | rotx158 rotate 9.00000000E-999 8 -> 9.0000000E-1000\r | |
108 | rotx160 rotate 1E-1007 -1 -> 1.00000000E-999\r | |
109 | rotx161 rotate 1E-1007 -8 -> 1.0E-1006\r | |
110 | rotx162 rotate 1E-1007 1 -> 1.0E-1006\r | |
111 | rotx163 rotate 1E-1007 8 -> 1.00000000E-999\r | |
112 | -- negatives\r | |
113 | rotx171 rotate -9.99999999E+999 -1 -> -9.99999999E+999\r | |
114 | rotx172 rotate -9.99999999E+999 -8 -> -9.99999999E+999\r | |
115 | rotx173 rotate -9.99999999E+999 1 -> -9.99999999E+999\r | |
116 | rotx174 rotate -9.99999999E+999 8 -> -9.99999999E+999\r | |
117 | rotx175 rotate -1E-999 -1 -> -1.00000000E-991\r | |
118 | rotx176 rotate -1E-999 -8 -> -1.0E-998\r | |
119 | rotx177 rotate -1E-999 1 -> -1.0E-998\r | |
120 | rotx178 rotate -1E-999 8 -> -1.00000000E-991\r | |
121 | rotx181 rotate -1.00000000E-999 -1 -> -1.0000000E-1000\r | |
122 | rotx182 rotate -1.00000000E-999 -8 -> -1E-1007\r | |
123 | rotx183 rotate -1.00000000E-999 1 -> -1E-1007\r | |
124 | rotx184 rotate -1.00000000E-999 8 -> -1.0000000E-1000\r | |
125 | rotx185 rotate -9.00000000E-999 -1 -> -9.0000000E-1000\r | |
126 | rotx186 rotate -9.00000000E-999 -8 -> -9E-1007\r | |
127 | rotx187 rotate -9.00000000E-999 1 -> -9E-1007\r | |
128 | rotx188 rotate -9.00000000E-999 8 -> -9.0000000E-1000\r | |
129 | rotx190 rotate -1E-1007 -1 -> -1.00000000E-999\r | |
130 | rotx191 rotate -1E-1007 -8 -> -1.0E-1006\r | |
131 | rotx192 rotate -1E-1007 1 -> -1.0E-1006\r | |
132 | rotx193 rotate -1E-1007 8 -> -1.00000000E-999\r | |
133 | \r | |
134 | -- more negatives (of sanities)\r | |
135 | rotx201 rotate -0 0 -> -0\r | |
136 | rotx202 rotate -0 2 -> -0\r | |
137 | rotx203 rotate -1 2 -> -100\r | |
138 | rotx204 rotate -1 8 -> -100000000\r | |
139 | rotx205 rotate -1 9 -> -1\r | |
140 | rotx206 rotate -1 -1 -> -100000000\r | |
141 | rotx207 rotate -123456789 -1 -> -912345678\r | |
142 | rotx208 rotate -123456789 -8 -> -234567891\r | |
143 | rotx209 rotate -123456789 -9 -> -123456789\r | |
144 | rotx210 rotate -0 -2 -> -0\r | |
145 | \r | |
146 | -- Specials; NaNs are handled as usual\r | |
147 | rotx781 rotate -Inf -8 -> -Infinity\r | |
148 | rotx782 rotate -Inf -1 -> -Infinity\r | |
149 | rotx783 rotate -Inf -0 -> -Infinity\r | |
150 | rotx784 rotate -Inf 0 -> -Infinity\r | |
151 | rotx785 rotate -Inf 1 -> -Infinity\r | |
152 | rotx786 rotate -Inf 8 -> -Infinity\r | |
153 | rotx787 rotate -1000 -Inf -> NaN Invalid_operation\r | |
154 | rotx788 rotate -Inf -Inf -> NaN Invalid_operation\r | |
155 | rotx789 rotate -1 -Inf -> NaN Invalid_operation\r | |
156 | rotx790 rotate -0 -Inf -> NaN Invalid_operation\r | |
157 | rotx791 rotate 0 -Inf -> NaN Invalid_operation\r | |
158 | rotx792 rotate 1 -Inf -> NaN Invalid_operation\r | |
159 | rotx793 rotate 1000 -Inf -> NaN Invalid_operation\r | |
160 | rotx794 rotate Inf -Inf -> NaN Invalid_operation\r | |
161 | \r | |
162 | rotx800 rotate Inf -Inf -> NaN Invalid_operation\r | |
163 | rotx801 rotate Inf -8 -> Infinity\r | |
164 | rotx802 rotate Inf -1 -> Infinity\r | |
165 | rotx803 rotate Inf -0 -> Infinity\r | |
166 | rotx804 rotate Inf 0 -> Infinity\r | |
167 | rotx805 rotate Inf 1 -> Infinity\r | |
168 | rotx806 rotate Inf 8 -> Infinity\r | |
169 | rotx807 rotate Inf Inf -> NaN Invalid_operation\r | |
170 | rotx808 rotate -1000 Inf -> NaN Invalid_operation\r | |
171 | rotx809 rotate -Inf Inf -> NaN Invalid_operation\r | |
172 | rotx810 rotate -1 Inf -> NaN Invalid_operation\r | |
173 | rotx811 rotate -0 Inf -> NaN Invalid_operation\r | |
174 | rotx812 rotate 0 Inf -> NaN Invalid_operation\r | |
175 | rotx813 rotate 1 Inf -> NaN Invalid_operation\r | |
176 | rotx814 rotate 1000 Inf -> NaN Invalid_operation\r | |
177 | rotx815 rotate Inf Inf -> NaN Invalid_operation\r | |
178 | \r | |
179 | rotx821 rotate NaN -Inf -> NaN\r | |
180 | rotx822 rotate NaN -1000 -> NaN\r | |
181 | rotx823 rotate NaN -1 -> NaN\r | |
182 | rotx824 rotate NaN -0 -> NaN\r | |
183 | rotx825 rotate NaN 0 -> NaN\r | |
184 | rotx826 rotate NaN 1 -> NaN\r | |
185 | rotx827 rotate NaN 1000 -> NaN\r | |
186 | rotx828 rotate NaN Inf -> NaN\r | |
187 | rotx829 rotate NaN NaN -> NaN\r | |
188 | rotx830 rotate -Inf NaN -> NaN\r | |
189 | rotx831 rotate -1000 NaN -> NaN\r | |
190 | rotx832 rotate -1 NaN -> NaN\r | |
191 | rotx833 rotate -0 NaN -> NaN\r | |
192 | rotx834 rotate 0 NaN -> NaN\r | |
193 | rotx835 rotate 1 NaN -> NaN\r | |
194 | rotx836 rotate 1000 NaN -> NaN\r | |
195 | rotx837 rotate Inf NaN -> NaN\r | |
196 | \r | |
197 | \r | |
198 | \r | |
199 | rotx841 rotate sNaN -Inf -> NaN Invalid_operation\r | |
200 | rotx842 rotate sNaN -1000 -> NaN Invalid_operation\r | |
201 | rotx843 rotate sNaN -1 -> NaN Invalid_operation\r | |
202 | rotx844 rotate sNaN -0 -> NaN Invalid_operation\r | |
203 | rotx845 rotate sNaN 0 -> NaN Invalid_operation\r | |
204 | rotx846 rotate sNaN 1 -> NaN Invalid_operation\r | |
205 | rotx847 rotate sNaN 1000 -> NaN Invalid_operation\r | |
206 | rotx848 rotate sNaN NaN -> NaN Invalid_operation\r | |
207 | rotx849 rotate sNaN sNaN -> NaN Invalid_operation\r | |
208 | rotx850 rotate NaN sNaN -> NaN Invalid_operation\r | |
209 | rotx851 rotate -Inf sNaN -> NaN Invalid_operation\r | |
210 | rotx852 rotate -1000 sNaN -> NaN Invalid_operation\r | |
211 | rotx853 rotate -1 sNaN -> NaN Invalid_operation\r | |
212 | rotx854 rotate -0 sNaN -> NaN Invalid_operation\r | |
213 | rotx855 rotate 0 sNaN -> NaN Invalid_operation\r | |
214 | rotx856 rotate 1 sNaN -> NaN Invalid_operation\r | |
215 | rotx857 rotate 1000 sNaN -> NaN Invalid_operation\r | |
216 | rotx858 rotate Inf sNaN -> NaN Invalid_operation\r | |
217 | rotx859 rotate NaN sNaN -> NaN Invalid_operation\r | |
218 | \r | |
219 | -- propagating NaNs\r | |
220 | rotx861 rotate NaN1 -Inf -> NaN1\r | |
221 | rotx862 rotate +NaN2 -1000 -> NaN2\r | |
222 | rotx863 rotate NaN3 1000 -> NaN3\r | |
223 | rotx864 rotate NaN4 Inf -> NaN4\r | |
224 | rotx865 rotate NaN5 +NaN6 -> NaN5\r | |
225 | rotx866 rotate -Inf NaN7 -> NaN7\r | |
226 | rotx867 rotate -1000 NaN8 -> NaN8\r | |
227 | rotx868 rotate 1000 NaN9 -> NaN9\r | |
228 | rotx869 rotate Inf +NaN10 -> NaN10\r | |
229 | rotx871 rotate sNaN11 -Inf -> NaN11 Invalid_operation\r | |
230 | rotx872 rotate sNaN12 -1000 -> NaN12 Invalid_operation\r | |
231 | rotx873 rotate sNaN13 1000 -> NaN13 Invalid_operation\r | |
232 | rotx874 rotate sNaN14 NaN17 -> NaN14 Invalid_operation\r | |
233 | rotx875 rotate sNaN15 sNaN18 -> NaN15 Invalid_operation\r | |
234 | rotx876 rotate NaN16 sNaN19 -> NaN19 Invalid_operation\r | |
235 | rotx877 rotate -Inf +sNaN20 -> NaN20 Invalid_operation\r | |
236 | rotx878 rotate -1000 sNaN21 -> NaN21 Invalid_operation\r | |
237 | rotx879 rotate 1000 sNaN22 -> NaN22 Invalid_operation\r | |
238 | rotx880 rotate Inf sNaN23 -> NaN23 Invalid_operation\r | |
239 | rotx881 rotate +NaN25 +sNaN24 -> NaN24 Invalid_operation\r | |
240 | rotx882 rotate -NaN26 NaN28 -> -NaN26\r | |
241 | rotx883 rotate -sNaN27 sNaN29 -> -NaN27 Invalid_operation\r | |
242 | rotx884 rotate 1000 -NaN30 -> -NaN30\r | |
243 | rotx885 rotate 1000 -sNaN31 -> -NaN31 Invalid_operation\r | |
244 | \r | |
245 | -- payload decapitate\r | |
246 | precision: 5\r | |
247 | rotx886 rotate 11 -sNaN1234567890 -> -NaN67890 Invalid_operation\r |