1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/math/t_r64dta.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,173 @@
1.4 +// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// e32test\math\t_r64dta.cpp
1.18 +//
1.19 +//
1.20 +
1.21 +#include <e32math.h>
1.22 +#include "t_vals.h"
1.23 +
1.24 +GLDEF_D TReal64 addInput[]=
1.25 + {
1.26 + KMaxTReal64/2,KMaxTReal64/2,
1.27 + -KMaxTReal64/2,-KMaxTReal64/2,
1.28 + -KMinTReal64,-KMinTReal64,
1.29 + KMinTReal64,KMinTReal64,
1.30 + KMinTReal64*2,-KMinTReal64,
1.31 + 0.0, 0.0,
1.32 + KMaxTReal64,-KMaxTReal64,
1.33 + 0.0, 1.0,
1.34 + 1.9999999999999997, 2.0,
1.35 + -1.9999999999999997, -2.0,
1.36 + 0.029345, 0.029345,
1.37 + 5.2972514E+164, 5.2972514E+164, // These numbers are sufficiently close
1.38 + 3.478065637643E+151, 3.478065637643E+151, //
1.39 + -3.478065637643E+151, -3.478065637643E+151, // to alter each other in addition...
1.40 + 9.8976E+138, -9.8976E+138,
1.41 + 1.23472E+7, 1.23472E+7,
1.42 + 3.19852E-6, -3.19852E-6,
1.43 + 1.39792E-19, 4.9761418241916116E-304,
1.44 + 5.2972514E+164, 5.2972514E+164, // and these are not.
1.45 + 3.478065637643E+150, 3.478065637643E+150,
1.46 + -3.478065637643E+150, -3.478065637643E+150,
1.47 + 9.8976E+135, -9.8976E+135,
1.48 + 1.23472E+7, 1.23472E+7,
1.49 + 3.19852E-7, 3.19852E-7,
1.50 + 1.39792E-21, 4.9761418241916116E-304,
1.51 + 0.0,KNegZeroTReal64,
1.52 + };
1.53 +
1.54 +//{-3.478065637643E+150,9.8976E+135} - These value used to fail when rounding up
1.55 +
1.56 +GLDEF_D TReal64 subInput[] =
1.57 + {
1.58 + KMaxTReal64/2, -KMaxTReal64/2,
1.59 + 0.0, 0.0,
1.60 + KMaxTReal64, KMaxTReal64,
1.61 + 1.0E+252, -1.0E+252,
1.62 + -KMaxTReal64, -KMaxTReal64,
1.63 + KMinTReal64, KMinTReal64,
1.64 + -KMinTReal64, -KMinTReal64,
1.65 + 0.0, 0.0,
1.66 + 2*KMinTReal64, KMinTReal64,
1.67 + -2*KMinTReal64, -KMinTReal64,
1.68 + 1.0, 4.5,
1.69 + 1.9999999999999997, 2.0,
1.70 + -1.9999999999999997, -2.0,
1.71 + 0.029345, 0.029345,
1.72 + 5.2972514E+164, 5.2972514E+164, // These numbers are sufficiently close
1.73 + 3.478065637643E+151, 3.478065637643E+151, //
1.74 + -3.478065637643E+151, -3.478065637643E+151, // to alter each other in addition...
1.75 + 9.8976E+138, -9.8976E+138,
1.76 + 1.23472E+7, 1.23472E+7,
1.77 + 3.19852E-6, -3.19852E-6,
1.78 + 1.39792E-19, 4.9761418241916116E-304,
1.79 + 5.2972514E+164, 5.2972514E+164, // and these are not.
1.80 + 3.478065637643E+150, 3.478065637643E+150,
1.81 + -3.478065637643E+150, -3.478065637643E+150,
1.82 + 9.8976E+135, -9.8976E+135,
1.83 + 1.23472E+7, 1.23472E+7,
1.84 + 3.19852E-7, 3.19852E-7,
1.85 + 1.39792E-21, 4.9761418241916116E-304,
1.86 + 0.0,KNegZeroTReal64,
1.87 + };
1.88 +
1.89 +// {4.5,1.9999999999999997} - These values used to fail when rounding up
1.90 +
1.91 +GLDEF_D TReal64 multInput[]=
1.92 + {
1.93 + 5066549580791808.0,4503599627370500.0,
1.94 + 1.0,1.0,
1.95 + 0.0, 0.0,
1.96 + KSqrtMaxTReal64, KSqrtMaxTReal64,
1.97 + -KSqrtMaxTReal64, -KSqrtMaxTReal64,
1.98 + KSqrtMinTReal64, KSqrtMinTReal64,
1.99 + -KSqrtMinTReal64, -KSqrtMinTReal64,
1.100 + 1.0, KMaxTReal64,
1.101 + 0.0, KMinTReal64,
1.102 + 1.0, 4.5,
1.103 + KMinTReal64, KMaxTReal64,
1.104 + 1.0, 0.9999999999999997,
1.105 + -1.0, -0.9999999999999997,
1.106 + 0.029345, 0.029345,
1.107 + 3.478065637643E+19, 3.478065637643E+19,
1.108 + -3.478065637643E+19, -3.478065637643E+19,
1.109 + -0.98976, -0.98976,
1.110 + -3.2774997937E+285, -3.2774997937E-285,
1.111 + 4.20761202627E+29, 4.20761202627E-29,
1.112 + -2.634209025E+202, 2.634209025E-202, // These pairs fail in ARM
1.113 + 3.1972712525626E+5, 1.39720715521579E+301,
1.114 + 3.1972712525626E-5, 1.39720715521579E-301,
1.115 + 4.2720759210720E+184, 3.9275015971055E+122, //
1.116 + 4.2720759210720E-184, 3.9275015971055E-122, //
1.117 + 0.0,KNegZeroTReal64,
1.118 + 2.0,0.0,
1.119 + };
1.120 +
1.121 +//{5066549580791808.0,4503599627370500.0} - This case used to fail when rounding up
1.122 +//{-2.634209025E+202, 2.634209025E-202} - This pair used to fail due to MulTop bug
1.123 +//{4.2720759210720E+184, 3.9275015971055E+122} - ditto
1.124 +//{4.2720759210720E-184, 3.9275015971055E-122} - ditto
1.125 +
1.126 +GLDEF_D TReal64 divInput[]=
1.127 + {
1.128 + 0.0, 0.0,
1.129 + KMaxTReal64, KMaxTReal64,
1.130 + -KMaxTReal64, -KMaxTReal64,
1.131 + 4.0, KMaxTReal64,
1.132 + 0.0, 1.0,
1.133 + -KMinTReal64, 1.0,
1.134 + KMinTReal64,KMinTReal64,
1.135 + -KMinTReal64, -KMinTReal64,
1.136 + 0.0, 1.0,
1.137 + 1.0, 0.9999999999999997,
1.138 + -1.0, -0.9999999999999997,
1.139 + 1.0, -1.0,
1.140 + 0.029345, 0.029345,
1.141 + -2.634209025E-295, -2.634209027E-295,
1.142 + 2.634209025E-295, 2.634209027E-295,
1.143 + -0.98976, -0.98976,
1.144 + 3.478065637643E+19, 3.478065637643E+19,
1.145 + 3.478065637643E-12,3.478065637644E-12,
1.146 + -3.2774997937E+53, -3.2774997937E+53,
1.147 + -3.2774997937E+153, -3.2774997937E-153,
1.148 + 4.20761202627E+29, 4.20761202627E-29,
1.149 + -4.20761202627E+29, -4.20761202627E-29,
1.150 + -2.634209025E+78, 2.634209025E-78,
1.151 + 3.1972712525626E-5, 1.39720715521579E+301,
1.152 + 3.1972712525626E+5, 1.39720715521579E-301,
1.153 + 4.2720759210720E-184, 3.9275015971055E+122,
1.154 + 4.2720759210720E+184, 3.9275015971055E-122,
1.155 + 0.0,KNegZeroTReal64,
1.156 + 2.0,0.0
1.157 + };
1.158 +
1.159 +//{-KMaxTReal64,4.0} - This pair used to fail before division bug fixed
1.160 +//{4.0, KMaxTReal64} - ditto
1.161 +
1.162 +GLDEF_D TReal64 unaryInput[] =
1.163 + {0.0,1.0,-1.0,KMaxTReal64,-KMaxTReal64,KMinTReal64,-KMinTReal64};
1.164 +
1.165 +GLDEF_D TReal64 incDecInput[] =
1.166 + {0.0,-1.0,1.0,2.0,KMaxTReal64,-KMaxTReal64,KMinTReal64,-KMinTReal64,
1.167 + -1672.7577037402694720,1612.8210207019271364,
1.168 + 9.0E+14,-9.0E+14,9.0E-14,-9.0E-14,
1.169 + 9.0E+16,-9.0E+16,9.0E-16,-9.0E-16};
1.170 +
1.171 +GLDEF_D TInt sizeAdd = sizeof(addInput)/sizeof(TReal64);
1.172 +GLDEF_D TInt sizeSub = sizeof(subInput)/sizeof(TReal64);
1.173 +GLDEF_D TInt sizeMult = sizeof(multInput)/sizeof(TReal64);
1.174 +GLDEF_D TInt sizeDiv = sizeof(divInput)/sizeof(TReal64);
1.175 +GLDEF_D TInt sizeUnary = sizeof(unaryInput)/sizeof(TReal64);
1.176 +GLDEF_D TInt sizeIncDec = sizeof(incDecInput)/sizeof(TReal64);