os/kernelhwsrv/kerneltest/e32test/math/t_r32dta.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/math/t_r32dta.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,157 @@
     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_r32dta.cpp
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#include <e32math.h>
    1.22 +
    1.23 +#include "t_vals.h"
    1.24 +
    1.25 +GLDEF_D TReal32 addInput[]=
    1.26 +	{
    1.27 +	KMaxTReal32/2,KMaxTReal32/2,
    1.28 +	-KMaxTReal32/2,-KMaxTReal32/2,
    1.29 +	-KMinTReal32,-KMinTReal32,
    1.30 +	KMinTReal32,KMinTReal32,
    1.31 +	KMinTReal32*2,-KMinTReal32,
    1.32 +	0.0f, 0.0f,
    1.33 +	KMaxTReal32,-KMaxTReal32,
    1.34 +	0.0f, 1.0f,			
    1.35 +	1.9997f, 2.0f,					
    1.36 +	-1.99997f, -2.0f,
    1.37 +	0.029345f, 0.029345f, 			
    1.38 +	5.2972514E+37f, 5.2972514E+37f,			// These numbers are sufficiently close	  
    1.39 +	3.4780656E+32f, 3.4780656E+32f,			//
    1.40 +	-3.4780656E+32f, -3.4780656E+32f,		// to alter each other in addition...	   
    1.41 +	9.8976E+26f, -9.8976E+26f,						
    1.42 +	1.23472E-9f, 1.23472E-9f, 						
    1.43 +	3.19852E-14f, -3.19852E-14f,						
    1.44 +	1.39792E-19f, 4.9761418E-37f,			
    1.45 +	5.2972514E+37f, 5.2972514E+37f,			// and these are not.
    1.46 +	3.4780656E+29f, 3.4780656E+29f,
    1.47 +	-3.4780656E+29f, -3.4780656E+29f,
    1.48 +	9.8976E+21f, -9.8976E+21f,
    1.49 +	1.23472E-5f, 1.23472E-5f, 
    1.50 +	3.19852E-13f, 3.19852E-13f,
    1.51 +	1.39792E-21f, 4.9761418E-37f
    1.52 +	};
    1.53 +
    1.54 +GLDEF_D TReal32 subInput[] = 
    1.55 +	{
    1.56 +	KMaxTReal32/2, -KMaxTReal32/2,
    1.57 +	0.0f,0.0f,
    1.58 +	KMaxTReal32, KMaxTReal32,
    1.59 +	1.0E+25f, -1.0E+25f,
    1.60 +	-KMaxTReal32, -KMaxTReal32,
    1.61 +	KMinTReal32, KMinTReal32,
    1.62 +	-KMinTReal32, -KMinTReal32,
    1.63 +	0.0f, 0.0f,
    1.64 +	2*KMinTReal32, KMinTReal32,
    1.65 +	-2*KMinTReal32, -KMinTReal32,
    1.66 +	1.0f, 4.5f,
    1.67 +	1.9999997f,2.0f,			
    1.68 +	-1.9999997f, -2.0f,
    1.69 +	0.029345f, 0.029345f,
    1.70 +	5.2972514E+37f, 5.2972514E+37f,			// These numbers are sufficiently close
    1.71 +	3.4780656E+32f, 3.4780656E+32f,			//
    1.72 +	-3.4780656E+32f, -3.4780656E+32f,		// to alter each other in addition...
    1.73 +	9.8976E+27f, -9.8976E+27f,						
    1.74 +	1.23472E-9f, 1.23472E-9f, 						
    1.75 +	3.19852E-14f, -3.19852E-14f,						
    1.76 +	1.39792E-19f, 4.9761418E-37f,			
    1.77 +	5.2972514E+37f, 5.2972514E+37f,			// and these are not.
    1.78 +	3.4780656E+29f, 3.4780656E+29f,
    1.79 +	-3.4780656E+29f, -3.4780656E+29f,
    1.80 +	9.8976E+21f, -9.8976E+21f,
    1.81 +	1.23472E-5f, 1.23472E-5f, 
    1.82 +	3.19852E-13f, 3.19852E-13f,
    1.83 +	1.39792E-21f, 4.9761418E-37f
    1.84 +	};
    1.85 +
    1.86 +	// {2.0f,-1.9999997f} - these values fail when rounding towards zero
    1.87 +	
    1.88 +GLDEF_D TReal32 multInput[]=
    1.89 +	{
    1.90 +	1.0f,1.0f,
    1.91 +	0.0f, 0.0f,
    1.92 +	KSqrtMaxTReal32,KSqrtMaxTReal32,					
    1.93 +	-KSqrtMaxTReal32, -KSqrtMaxTReal32,
    1.94 +	KSqrtMinTReal32, KSqrtMinTReal32,					
    1.95 +	-KSqrtMinTReal32, -KSqrtMinTReal32,
    1.96 +	1.0f, KMaxTReal32,
    1.97 +	0.0f, KMinTReal32,
    1.98 +	1.0f, 4.5f,
    1.99 +	KMinTReal32, KMaxTReal32, 
   1.100 +	1.0f, 0.9999997f,
   1.101 +	-1.0f, -0.9999997f,
   1.102 +	0.029345f, 0.029345f,
   1.103 +	3.4780656E+18f, 3.4780656E+18f,
   1.104 +	-3.4780656E+18f, -3.4780656E+18f,
   1.105 +	-0.98976f, -0.98976f,						
   1.106 +	-3.2774997E+36f, -3.2774997E-36f,
   1.107 +	4.2076120E+12f, 4.2076120E-12f,			
   1.108 +	-2.6342090E+30f, 2.6342090E-30f, 
   1.109 +	3.1972712E+5f, 1.3972071E+31f,
   1.110 +	3.1972712E-5f, 1.3972071E-31f,
   1.111 +	4.2720759E+12f, 3.9275015E+24f,
   1.112 +	4.2720759E-12f, 3.9275015E-24f
   1.113 +	};
   1.114 +
   1.115 +GLDEF_D TReal32 divInput[]=
   1.116 +	{
   1.117 +	0.0f, 0.0f,
   1.118 +	KMaxTReal32, KMaxTReal32,
   1.119 +	-KMaxTReal32, -KMaxTReal32,
   1.120 +	4.0f, KMaxTReal32,
   1.121 +	0.0f, 1.0f,
   1.122 +	-KMinTReal32, 1.0f,
   1.123 +	KMinTReal32,KMinTReal32,
   1.124 +	-KMinTReal32, -KMinTReal32,
   1.125 +	0.0f, 1.0f,  
   1.126 +	1.0f, 0.9999997f,
   1.127 +	-1.0f, -0.9999997f,
   1.128 +	1.0f, -1.0f,
   1.129 +	0.029345f, 0.029345f,
   1.130 +	2.6342090E-36f, 2.6342090E-36f,
   1.131 +   	-0.98976f, -0.98976f,
   1.132 +	3.4780656E+19f, 3.4780656E+19f,		
   1.133 +	3.4780656E-12f,3.4780656E-12f,
   1.134 +	-3.2774997E+5f, -3.2774997E+5f,
   1.135 +	-3.2774997E+18f, -3.2774997E-18f,
   1.136 +	4.2076120E+4f, 4.2076120E-4f,
   1.137 +	-4.2076120E+4f, -4.2076120E-4f,
   1.138 +	-2.6342090E+6f, 2.6342090E-6f,
   1.139 +	3.1972712E-2f, 1.3972071E+34f,
   1.140 +	3.1972712E+2f, 1.3972071E-34f,
   1.141 +	4.2720759E-13f, 3.927501E+23f,
   1.142 +	4.2720759E+13f, 3.927501E-23f
   1.143 +	};
   1.144 +
   1.145 +GLDEF_D TReal32 unaryInput[] =
   1.146 +	{0.0f,1.0f,-1.0f,KMaxTReal32,-KMaxTReal32,KMinTReal32,-KMinTReal32};
   1.147 +
   1.148 +GLDEF_D TReal32 incDecInput[] =
   1.149 +	{-1.0f,0.0f,1.0f,-1672.7577037f,1612.8210207f,
   1.150 +	KMaxTReal32,-KMaxTReal32,KMinTReal32,-KMinTReal32,
   1.151 +	9.0E+14f,-9.0E+14f,9.0E-14f,-9.0E-14f,
   1.152 +	9.0E+16f,-9.0E+16f,9.0E-16f,-9.0E-16f};
   1.153 +
   1.154 +// sizes of arrays	
   1.155 +GLDEF_D TInt sizeAdd = sizeof(addInput)/sizeof(TReal32);
   1.156 +GLDEF_D TInt sizeSub = sizeof(subInput)/sizeof(TReal32);
   1.157 +GLDEF_D TInt sizeMult = sizeof(multInput)/sizeof(TReal32);
   1.158 +GLDEF_D TInt sizeDiv = sizeof(divInput)/sizeof(TReal32);
   1.159 +GLDEF_D TInt sizeUnary = sizeof(unaryInput)/sizeof(TReal32);
   1.160 +GLDEF_D TInt sizeIncDec = sizeof(incDecInput)/sizeof(TReal32);