|
1 // Copyright (c) 1996-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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // e32test\math\t_r32dta.cpp |
|
15 // |
|
16 // |
|
17 |
|
18 #include <e32math.h> |
|
19 |
|
20 #include "t_vals.h" |
|
21 |
|
22 GLDEF_D TReal32 addInput[]= |
|
23 { |
|
24 KMaxTReal32/2,KMaxTReal32/2, |
|
25 -KMaxTReal32/2,-KMaxTReal32/2, |
|
26 -KMinTReal32,-KMinTReal32, |
|
27 KMinTReal32,KMinTReal32, |
|
28 KMinTReal32*2,-KMinTReal32, |
|
29 0.0f, 0.0f, |
|
30 KMaxTReal32,-KMaxTReal32, |
|
31 0.0f, 1.0f, |
|
32 1.9997f, 2.0f, |
|
33 -1.99997f, -2.0f, |
|
34 0.029345f, 0.029345f, |
|
35 5.2972514E+37f, 5.2972514E+37f, // These numbers are sufficiently close |
|
36 3.4780656E+32f, 3.4780656E+32f, // |
|
37 -3.4780656E+32f, -3.4780656E+32f, // to alter each other in addition... |
|
38 9.8976E+26f, -9.8976E+26f, |
|
39 1.23472E-9f, 1.23472E-9f, |
|
40 3.19852E-14f, -3.19852E-14f, |
|
41 1.39792E-19f, 4.9761418E-37f, |
|
42 5.2972514E+37f, 5.2972514E+37f, // and these are not. |
|
43 3.4780656E+29f, 3.4780656E+29f, |
|
44 -3.4780656E+29f, -3.4780656E+29f, |
|
45 9.8976E+21f, -9.8976E+21f, |
|
46 1.23472E-5f, 1.23472E-5f, |
|
47 3.19852E-13f, 3.19852E-13f, |
|
48 1.39792E-21f, 4.9761418E-37f |
|
49 }; |
|
50 |
|
51 GLDEF_D TReal32 subInput[] = |
|
52 { |
|
53 KMaxTReal32/2, -KMaxTReal32/2, |
|
54 0.0f,0.0f, |
|
55 KMaxTReal32, KMaxTReal32, |
|
56 1.0E+25f, -1.0E+25f, |
|
57 -KMaxTReal32, -KMaxTReal32, |
|
58 KMinTReal32, KMinTReal32, |
|
59 -KMinTReal32, -KMinTReal32, |
|
60 0.0f, 0.0f, |
|
61 2*KMinTReal32, KMinTReal32, |
|
62 -2*KMinTReal32, -KMinTReal32, |
|
63 1.0f, 4.5f, |
|
64 1.9999997f,2.0f, |
|
65 -1.9999997f, -2.0f, |
|
66 0.029345f, 0.029345f, |
|
67 5.2972514E+37f, 5.2972514E+37f, // These numbers are sufficiently close |
|
68 3.4780656E+32f, 3.4780656E+32f, // |
|
69 -3.4780656E+32f, -3.4780656E+32f, // to alter each other in addition... |
|
70 9.8976E+27f, -9.8976E+27f, |
|
71 1.23472E-9f, 1.23472E-9f, |
|
72 3.19852E-14f, -3.19852E-14f, |
|
73 1.39792E-19f, 4.9761418E-37f, |
|
74 5.2972514E+37f, 5.2972514E+37f, // and these are not. |
|
75 3.4780656E+29f, 3.4780656E+29f, |
|
76 -3.4780656E+29f, -3.4780656E+29f, |
|
77 9.8976E+21f, -9.8976E+21f, |
|
78 1.23472E-5f, 1.23472E-5f, |
|
79 3.19852E-13f, 3.19852E-13f, |
|
80 1.39792E-21f, 4.9761418E-37f |
|
81 }; |
|
82 |
|
83 // {2.0f,-1.9999997f} - these values fail when rounding towards zero |
|
84 |
|
85 GLDEF_D TReal32 multInput[]= |
|
86 { |
|
87 1.0f,1.0f, |
|
88 0.0f, 0.0f, |
|
89 KSqrtMaxTReal32,KSqrtMaxTReal32, |
|
90 -KSqrtMaxTReal32, -KSqrtMaxTReal32, |
|
91 KSqrtMinTReal32, KSqrtMinTReal32, |
|
92 -KSqrtMinTReal32, -KSqrtMinTReal32, |
|
93 1.0f, KMaxTReal32, |
|
94 0.0f, KMinTReal32, |
|
95 1.0f, 4.5f, |
|
96 KMinTReal32, KMaxTReal32, |
|
97 1.0f, 0.9999997f, |
|
98 -1.0f, -0.9999997f, |
|
99 0.029345f, 0.029345f, |
|
100 3.4780656E+18f, 3.4780656E+18f, |
|
101 -3.4780656E+18f, -3.4780656E+18f, |
|
102 -0.98976f, -0.98976f, |
|
103 -3.2774997E+36f, -3.2774997E-36f, |
|
104 4.2076120E+12f, 4.2076120E-12f, |
|
105 -2.6342090E+30f, 2.6342090E-30f, |
|
106 3.1972712E+5f, 1.3972071E+31f, |
|
107 3.1972712E-5f, 1.3972071E-31f, |
|
108 4.2720759E+12f, 3.9275015E+24f, |
|
109 4.2720759E-12f, 3.9275015E-24f |
|
110 }; |
|
111 |
|
112 GLDEF_D TReal32 divInput[]= |
|
113 { |
|
114 0.0f, 0.0f, |
|
115 KMaxTReal32, KMaxTReal32, |
|
116 -KMaxTReal32, -KMaxTReal32, |
|
117 4.0f, KMaxTReal32, |
|
118 0.0f, 1.0f, |
|
119 -KMinTReal32, 1.0f, |
|
120 KMinTReal32,KMinTReal32, |
|
121 -KMinTReal32, -KMinTReal32, |
|
122 0.0f, 1.0f, |
|
123 1.0f, 0.9999997f, |
|
124 -1.0f, -0.9999997f, |
|
125 1.0f, -1.0f, |
|
126 0.029345f, 0.029345f, |
|
127 2.6342090E-36f, 2.6342090E-36f, |
|
128 -0.98976f, -0.98976f, |
|
129 3.4780656E+19f, 3.4780656E+19f, |
|
130 3.4780656E-12f,3.4780656E-12f, |
|
131 -3.2774997E+5f, -3.2774997E+5f, |
|
132 -3.2774997E+18f, -3.2774997E-18f, |
|
133 4.2076120E+4f, 4.2076120E-4f, |
|
134 -4.2076120E+4f, -4.2076120E-4f, |
|
135 -2.6342090E+6f, 2.6342090E-6f, |
|
136 3.1972712E-2f, 1.3972071E+34f, |
|
137 3.1972712E+2f, 1.3972071E-34f, |
|
138 4.2720759E-13f, 3.927501E+23f, |
|
139 4.2720759E+13f, 3.927501E-23f |
|
140 }; |
|
141 |
|
142 GLDEF_D TReal32 unaryInput[] = |
|
143 {0.0f,1.0f,-1.0f,KMaxTReal32,-KMaxTReal32,KMinTReal32,-KMinTReal32}; |
|
144 |
|
145 GLDEF_D TReal32 incDecInput[] = |
|
146 {-1.0f,0.0f,1.0f,-1672.7577037f,1612.8210207f, |
|
147 KMaxTReal32,-KMaxTReal32,KMinTReal32,-KMinTReal32, |
|
148 9.0E+14f,-9.0E+14f,9.0E-14f,-9.0E-14f, |
|
149 9.0E+16f,-9.0E+16f,9.0E-16f,-9.0E-16f}; |
|
150 |
|
151 // sizes of arrays |
|
152 GLDEF_D TInt sizeAdd = sizeof(addInput)/sizeof(TReal32); |
|
153 GLDEF_D TInt sizeSub = sizeof(subInput)/sizeof(TReal32); |
|
154 GLDEF_D TInt sizeMult = sizeof(multInput)/sizeof(TReal32); |
|
155 GLDEF_D TInt sizeDiv = sizeof(divInput)/sizeof(TReal32); |
|
156 GLDEF_D TInt sizeUnary = sizeof(unaryInput)/sizeof(TReal32); |
|
157 GLDEF_D TInt sizeIncDec = sizeof(incDecInput)/sizeof(TReal32); |