Update contrib.
1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\math\t_float3.cpp
15 // File for T_FLOAT.CPP containing data for test5, test6, test7 and test8
16 // T_FLOAT.CPP split into header files because there seems to be too much static data for GCC
24 GLDEF_D DtoR_TEST64 testd2[]=
26 DtoR_TEST64(_L("1.000000000000000000000001"),1.0),
27 DtoR_TEST64(_L("1.00000000000000000000001"),1.0),
28 DtoR_TEST64(_L("1.0000000000000000000001"),1.0),
29 DtoR_TEST64(_L("1.000000000000000000001"),1.0),
30 DtoR_TEST64(_L("1.0000000000000000001"),1.0),
31 DtoR_TEST64(_L("1.000000000000000001"),1.0),
32 DtoR_TEST64(_L("1.000000000000001"),1.000000000000001),
33 DtoR_TEST64(_L("1.0000000000000001E+10"),1.0000000000000002E+10),
34 DtoR_TEST64(_L("1.0000000000000001E-10"),1.0E-10),
35 DtoR_TEST64(_L("1.00000000000001E8"),1.00000000000001E8),
36 DtoR_TEST64(_L("1.00000000000001E-8"),1.00000000000001E-8),
38 DtoR_TEST64(_L("1.23412341234e-7"),1.23412341234E-7),
39 DtoR_TEST64(_L("0.000000123412341234"),1.23412341234E-7),
40 DtoR_TEST64(_L("0.0000000123412341234"),1.23412341234E-8),
42 DtoR_TEST64(_L("0.29"),0.29),
43 DtoR_TEST64(_L("0.2900"),0.2900),
44 DtoR_TEST64(_L("0.2900"),0.29),
46 DtoR_TEST64(_L("0.0"),0.0),
47 DtoR_TEST64(_L("1.0"),1.0),
48 DtoR_TEST64(_L("10.0"),10.0),
49 DtoR_TEST64(_L("100.0"),100.0),
50 DtoR_TEST64(_L("1000.0"),1000.0),
51 DtoR_TEST64(_L("0.1"),0.1),
52 DtoR_TEST64(_L("0.01"),0.01),
53 DtoR_TEST64(_L("0.001"),0.001),
54 DtoR_TEST64(_L("0.0001"),0.0001),
56 DtoR_TEST64(_L("9.99999999999999999"),9.99999999999999999),
57 DtoR_TEST64(_L("9.99999999999999"),9.99999999999999),
58 DtoR_TEST64(_L("9.9999999999999"),9.9999999999999),
59 DtoR_TEST64(_L("9.999999999"),9.999999999),
61 DtoR_TEST64(_L(".015"),0.015),
62 DtoR_TEST64(_L("1.00E-15"),1.0E-15),
63 DtoR_TEST64(_L("1.0E-07"),1.00E-7),
65 DtoR_TEST64(_L("1024.0"),1024.0),
66 DtoR_TEST64(_L("1E10"),1E10),
67 DtoR_TEST64(_L("1E20"),1E20),
68 DtoR_TEST64(_L("1E30"),1E30),
69 DtoR_TEST64(_L("1E40"),1E40),
70 DtoR_TEST64(_L("1E50"),1E50),
71 // DtoR_TEST64(_L("1E60"),1E60),
72 DtoR_TEST64(_L("1E70"),1E70),
73 DtoR_TEST64(_L("1E80"),1E80),
74 DtoR_TEST64(_L("1E90"),1E90),
75 DtoR_TEST64(_L("1E98"),1E98),
76 // DtoR_TEST64(_L("1E99"),1E99),
77 DtoR_TEST64(_L("1E100"),1E100),
78 DtoR_TEST64(_L("1E200"),1E200),
79 DtoR_TEST64(_L("1E300"),1E300),
80 DtoR_TEST64(_L("1.7976931348623157E+308"),1.7976931348623157E+308),
82 DtoR_TEST64(_L("-1024.0"),-1024.0),
83 DtoR_TEST64(_L("-1E10"),-1E10),
84 DtoR_TEST64(_L("-1E20"),-1E20),
85 DtoR_TEST64(_L("-1E30"),-1E30),
86 DtoR_TEST64(_L("-1E40"),-1E40),
87 DtoR_TEST64(_L("-1E50"),-1E50),
88 // DtoR_TEST64(_L("-1E60"),-1E60),
89 DtoR_TEST64(_L("-1E70"),-1E70),
90 DtoR_TEST64(_L("-1E80"),-1E80),
91 DtoR_TEST64(_L("-1E90"),-1E90),
92 DtoR_TEST64(_L("-1E98"),-1E98),
93 // DtoR_TEST64(_L("-1E99"),-1E99),
94 DtoR_TEST64(_L("-1E100"),-1E100),
95 DtoR_TEST64(_L("-1E200"),-1E200),
96 DtoR_TEST64(_L("-1E300"),-1E300),
97 DtoR_TEST64(_L("-1.7976931348623157E+308"),-1.7976931348623157E+308),
99 DtoR_TEST64(_L("123456789012345.0"),123456789012345.0),
100 DtoR_TEST64(_L("12345678901234567.0"),12345678901234568.0), // 54 bits. Check we are rounding up
101 DtoR_TEST64(_L("1.23456789012345"),1.23456789012345),
102 DtoR_TEST64(_L("1.2345678901234567"),1.2345678901234567),
103 DtoR_TEST64(_L("1.2345678901234567890"),1.2345678901234567890),
104 // DtoR_TEST64(_L("1.23456789012345E+38"),1.23456789012345E+38),
105 DtoR_TEST64(_L("1.2345678901234567E+38"),1.2345678901234567E+38),
106 DtoR_TEST64(_L("1.23456789012345E+299"),1.23456789012345E+299),
107 // DtoR_TEST64(_L("1.2345678901234567E+299"),1.2345678901234567E+299),
108 // DtoR_TEST64(_L("1.23456789012345E-75"),1.23456789012345E-75),
109 DtoR_TEST64(_L("1.2345678901234567E-75"),1.2345678901234567E-75),
110 DtoR_TEST64(_L("1.23456789012345E-146"),1.23456789012345E-146),
111 // DtoR_TEST64(_L("1.2345678901234567E-146"),1.2345678901234567E-146),
113 DtoR_TEST64(_L("1E-10"),1E-10),
114 // DtoR_TEST64(_L("1E-20"),1E-20),
115 DtoR_TEST64(_L("1E-30"),1E-30),
116 // DtoR_TEST64(_L("1E-40"),1E-40),
117 DtoR_TEST64(_L("1E-50"),1E-50),
118 DtoR_TEST64(_L("1E-60"),1E-60),
119 DtoR_TEST64(_L("1E-70"),1E-70),
120 DtoR_TEST64(_L("1E-80"),1E-80),
121 DtoR_TEST64(_L("1E-90"),1E-90),
122 DtoR_TEST64(_L("1E-98"),1E-98),
123 DtoR_TEST64(_L("1E-99"),1E-99),
124 // DtoR_TEST64(_L("1E-100"),1E-100),
125 // DtoR_TEST64(_L("1E-200"),1E-200),
126 DtoR_TEST64(_L("1E-300"),1E-300),
127 DtoR_TEST64(_L("2.2250738585072015E-308"),2.2250738585072015E-308),
129 DtoR_TEST64(_L("-1E-10"),-1E-10),
130 // DtoR_TEST64(_L("-1E-20"),-1E-20),
131 DtoR_TEST64(_L("-1E-30"),-1E-30),
132 // DtoR_TEST64(_L("-1E-40"),-1E-40),
133 DtoR_TEST64(_L("-1E-50"),-1E-50),
134 DtoR_TEST64(_L("-1E-60"),-1E-60),
135 DtoR_TEST64(_L("-1E-70"),-1E-70),
136 DtoR_TEST64(_L("-1E-80"),-1E-80),
137 DtoR_TEST64(_L("-1E-90"),-1E-90),
138 DtoR_TEST64(_L("-1E-98"),-1E-98),
139 DtoR_TEST64(_L("-1E-99"),-1E-99),
140 // DtoR_TEST64(_L("-1E-100"),-1E-100),
141 // DtoR_TEST64(_L("-1E-200"),-1E-200),
142 DtoR_TEST64(_L("-1E-300"),-1E-300),
143 DtoR_TEST64(_L("-2.2250738585072015E-308"),-2.2250738585072015E-308),
145 DtoR_TEST64(_L("+1.23"),1.23),
146 DtoR_TEST64(_L("003.45"),3.45),
147 DtoR_TEST64(_L("0.0000000000000015"),1.5E-15),
148 // DtoR_TEST64(_L("1.234e-40"),1.234E-40)
151 GLDEF_D TUint size_testd2=sizeof(testd2);
153 GLDEF_D DtoR_TEST64 testApprox[]=
156 DtoR_TEST64(_L("1.23412341234e-11"),1.23412341234E-11),
157 DtoR_TEST64(_L("0.0000000000123412341234"),1.23412341234E-11),
160 DtoR_TEST64(_L("1.2345678901234567E-146"),1.2345678901234567E-146),
163 DtoR_TEST64(_L("1E-40"),1E-40),
164 DtoR_TEST64(_L("-1E-40"),-1E-40),
165 DtoR_TEST64(_L("1E60"),1E60),
166 DtoR_TEST64(_L("-1E60"),-1E60),
167 DtoR_TEST64(_L("1E-20"),1E-20),
168 DtoR_TEST64(_L("-1E-20"),-1E-20),
169 DtoR_TEST64(_L("1E99"),1E99),
170 DtoR_TEST64(_L("-1E99"),-1E99),
171 DtoR_TEST64(_L("1.2345678901234567E+299"),1.2345678901234567E+299),
172 DtoR_TEST64(_L("1.23456789012345E-75"),1.23456789012345E-75),
173 DtoR_TEST64(_L("1E-100"),1E-100),
174 DtoR_TEST64(_L("-1E-100"),-1E-100),
175 DtoR_TEST64(_L("1E-200"),1E-200),
176 DtoR_TEST64(_L("-1E-200"),-1E-200),
177 DtoR_TEST64(_L("1.234e-40"),1.234E-40),
178 DtoR_TEST64(_L("1.23456789012345E+38"),1.23456789012345E+38),
181 GLDEF_D TUint size_testApprox=sizeof(testApprox);
183 GLDEF_D DtoR_TEST32 testd32[]=
185 DtoR_TEST32(_L("0.29"),0.29f),
187 DtoR_TEST32(_L("0.0"),0.0f),
188 DtoR_TEST32(_L("1.0"),1.0f),
189 DtoR_TEST32(_L("10.0"),10.0f),
190 DtoR_TEST32(_L("100.0"),100.0f),
191 DtoR_TEST32(_L("1000.0"),1000.0f),
192 DtoR_TEST32(_L("0.1"),0.1f),
193 DtoR_TEST32(_L("0.01"),0.01f),
194 DtoR_TEST32(_L("0.001"),0.001f),
195 DtoR_TEST32(_L("0.0001"),0.0001f),
197 DtoR_TEST32(_L("9.99999999999999"),10.0f),
198 DtoR_TEST32(_L("9.9999999"),9.99999999f),
199 DtoR_TEST32(_L("9.9999"),9.9999f),
201 DtoR_TEST32(_L(".015"),0.015f),
202 DtoR_TEST32(_L("1.00E-15"),1.0E-15f),
203 DtoR_TEST32(_L("1.0E-07"),1.0E-7f),
205 DtoR_TEST32(_L("1024.0"),1024.0f),
206 DtoR_TEST32(_L("1E10"),1E10f),
207 DtoR_TEST32(_L("1E20"),1E+20f),
208 DtoR_TEST32(_L("1E30"),1E30f),
209 DtoR_TEST32(_L("3.40282356E+38"),KMaxTReal32),
211 DtoR_TEST32(_L("-1024.0"),-1024.0f),
212 DtoR_TEST32(_L("-1E10"),-1E10f),
213 DtoR_TEST32(_L("-1E20"),-1E20f),
214 DtoR_TEST32(_L("-1E30"),-1E+30f),
215 DtoR_TEST32(_L("-3.40282356E+38"),-KMaxTReal32),
217 DtoR_TEST32(_L("1234567.0"),1234567.0f),
218 DtoR_TEST32(_L("1234567890.0"),1234567890.0f),
219 DtoR_TEST32(_L("1.234567"),1.234567f),
220 DtoR_TEST32(_L("1.234567890"),1.234567890f),
221 DtoR_TEST32(_L("1.23456789012"),1.23456789012f),
222 DtoR_TEST32(_L("1.23456E+38"),1.23456E+38f),
223 DtoR_TEST32(_L("1.23456789E+38"),1.23456789E+38f),
224 DtoR_TEST32(_L("1.23456E-13"),1.23456E-13f),
225 DtoR_TEST32(_L("1.23456789012E-13"),1.23456789012E-13f),
227 DtoR_TEST32(_L("1E-10"),1E-10f),
228 DtoR_TEST32(_L("1E-20"),1E-20f),
229 DtoR_TEST32(_L("1E-30"),1E-30f),
230 DtoR_TEST32(_L("1.17549436e-38"),1.17549436e-38f),
232 DtoR_TEST32(_L("-1E-10"),-1E-10f),
233 DtoR_TEST32(_L("-1E-20"),-1E-20f),
234 DtoR_TEST32(_L("-1E-30"),-1E-30f),
235 DtoR_TEST32(_L("-1.17549436e-38"),-1.17549436e-38f),
237 DtoR_TEST32(_L("+1.23"),1.23f),
238 DtoR_TEST32(_L("003.45"),3.45f),
239 DtoR_TEST32(_L("0.0000000000000015"),1.5E-15f),
240 DtoR_TEST32(_L("1.234e-4"),1.234E-4f)
243 GLDEF_D TUint size_testd32=sizeof(testd32);
245 GLDEF_D DtoR_ERR_TEST testerr3[]=
247 DtoR_ERR_TEST(KNullDesC,KErrGeneral),
248 DtoR_ERR_TEST(_L("E-20"),KErrGeneral),
249 DtoR_ERR_TEST(_L("1.#INF"),KErrNone),
250 DtoR_ERR_TEST(_L("1.#NAN"),KErrNone),
251 DtoR_ERR_TEST(_L("c.fgh"),KErrGeneral),
252 DtoR_ERR_TEST(_L("xyz"),KErrGeneral),
253 DtoR_ERR_TEST(_L("1.0E"),KErrNone),
254 DtoR_ERR_TEST(_L("1.0E2147483648"),KErrOverflow),
255 DtoR_ERR_TEST(_L("1.234567801234567890E+38"),KErrNone),
256 DtoR_ERR_TEST(_L("3.456789012345678901E-38"),KErrNone),
257 DtoR_ERR_TEST(_L("3.4028236E+38"),KErrOverflow),
258 DtoR_ERR_TEST(_L("1.1754943E-38"),KErrNone),
259 DtoR_ERR_TEST(_L("1.0E-38"),KErrNone),
260 DtoR_ERR_TEST(_L("4.0E+38"),KErrOverflow),
261 DtoR_ERR_TEST(_L("1.0E-39"),KErrNone),
262 DtoR_ERR_TEST(_L("1.0E+39"),KErrOverflow),
263 DtoR_ERR_TEST(_L("3.0E40"),KErrOverflow),
264 DtoR_ERR_TEST(_L("6.9E-46"),KErrUnderflow),
265 DtoR_ERR_TEST(_L("1.0E-325"),KErrUnderflow),
266 DtoR_ERR_TEST(_L("2.0E-400"),KErrUnderflow),
267 DtoR_ERR_TEST(_L("2.0E+400"),KErrOverflow),
270 GLDEF_D TUint size_testerr3=sizeof(testerr3);
272 GLDEF_D CALC_TEST calctest[]=
274 CALC_TEST(_L("1.23412341234"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234")),
275 CALC_TEST(_L("0.123412341234"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-01")),
276 CALC_TEST(_L("0.0123412341234"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-02")),
277 CALC_TEST(_L("0.00123412341234"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-03")),
278 CALC_TEST(_L("0.000123412341234"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-04")),
279 CALC_TEST(_L("0.0000123412341234"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-05")),
280 CALC_TEST(_L("0.00000123412341234"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-06")),
281 CALC_TEST(_L("0.000000123412341234"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-07")),
282 CALC_TEST(_L("0.0000000123412341234"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-08")),
283 CALC_TEST(_L("0.00000000123412341234"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-09")),
284 CALC_TEST(_L("0.000000000123412341234"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-10")),
285 CALC_TEST(_L("0.0000000000123412341234"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-11")),
286 CALC_TEST(_L("0.00000000000123412341234"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-12")),
287 CALC_TEST(_L("1.23412341234E-7"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-07")),
288 CALC_TEST(_L("1.23412341234E-8"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-08")),
289 CALC_TEST(_L("1.23412341234E-9"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-09")),
290 CALC_TEST(_L("1.23412341234E-10"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-10")),
291 CALC_TEST(_L("1.23412341234E-11"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-11")),
292 CALC_TEST(_L("1.23412341234E-12"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-12")),
293 CALC_TEST(_L("0.00000000000000"),KRealFormatCalculator,20,12,'.',',',0,_S("0")),
294 CALC_TEST(_L("0.000000000000009999999999999"),KRealFormatCalculator,20,12,'.',',',0,_S("1E-14")),
295 CALC_TEST(_L("0.000000000000000000009999999999999"),KRealFormatCalculator,20,12,'.',',',0,_S("1E-20")),
296 CALC_TEST(_L("999999999999.5"),KRealFormatCalculator,20,12,'.',',',0,_S("1E+12")),
297 CALC_TEST(_L("999999999999.4"),KRealFormatCalculator,20,12,'.',',',0,_S("999999999999")),
298 CALC_TEST(_L("1.234123412341"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234")),
299 CALC_TEST(_L("0.123412341234"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341234E-01")),
300 CALC_TEST(_L("0.012341234123"),KRealFormatCalculator,20,12,'.',',',0,_S("1.2341234123E-02")),
301 CALC_TEST(_L("0.001234123412"),KRealFormatCalculator,20,12,'.',',',0,_S("1.234123412E-03")),
302 CALC_TEST(_L("0.000123412341"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412341E-04")),
303 CALC_TEST(_L("0.000012341234"),KRealFormatCalculator,20,12,'.',',',0,_S("1.2341234E-05")),
304 CALC_TEST(_L("0.000001234123"),KRealFormatCalculator,20,12,'.',',',0,_S("1.234123E-06")),
305 CALC_TEST(_L("0.000000123412"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23412E-07")),
306 CALC_TEST(_L("0.000000012341"),KRealFormatCalculator,20,12,'.',',',0,_S("1.2341E-08")),
307 CALC_TEST(_L("0.000000001234"),KRealFormatCalculator,20,12,'.',',',0,_S("1.234E-09")),
308 CALC_TEST(_L("0.000000000123"),KRealFormatCalculator,20,12,'.',',',0,_S("1.23E-10")),
309 CALC_TEST(_L("0.000000000012"),KRealFormatCalculator,20,12,'.',',',0,_S("1.2E-11")),
310 CALC_TEST(_L("0.000000000001"),KRealFormatCalculator,20,12,'.',',',0,_S("1E-12")),
311 CALC_TEST(_L("0.12341234123"),KRealFormatCalculator,20,12,'.',',',0,_S("0.12341234123")),
312 CALC_TEST(_L("0.01234123412"),KRealFormatCalculator,20,12,'.',',',0,_S("0.01234123412")),
313 CALC_TEST(_L("0.00123412341"),KRealFormatCalculator,20,12,'.',',',0,_S("0.00123412341")),
314 CALC_TEST(_L("0.00012341234"),KRealFormatCalculator,20,12,'.',',',0,_S("0.00012341234")),
315 CALC_TEST(_L("0.00001234123"),KRealFormatCalculator,20,12,'.',',',0,_S("0.00001234123")),
316 CALC_TEST(_L("0.00000123412"),KRealFormatCalculator,20,12,'.',',',0,_S("0.00000123412")),
317 CALC_TEST(_L("0.00000012341"),KRealFormatCalculator,20,12,'.',',',0,_S("0.00000012341")),
318 CALC_TEST(_L("0.00000001234"),KRealFormatCalculator,20,12,'.',',',0,_S("0.00000001234")),
319 CALC_TEST(_L("0.00000000123"),KRealFormatCalculator,20,12,'.',',',0,_S("0.00000000123")),
320 CALC_TEST(_L("0.00000000012"),KRealFormatCalculator,20,12,'.',',',0,_S("0.00000000012")),
321 CALC_TEST(_L("0.00000000001"),KRealFormatCalculator,20,12,'.',',',0,_S("0.00000000001")),
322 CALC_TEST(_L("0.000000000001"),KRealFormatCalculator,20,12,'.',',',0,_S("1E-12")),
323 CALC_TEST(_L("-1.234E19"),KRealFormatCalculator,20,12,'.',',',0,_S("-1.234E+19")),
326 GLDEF_D TUint size_calctest=sizeof(calctest);