Update contrib.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\math\t_gcc64.cpp
15 // From UP_GCC.CPP, for emulating UP_GCC in T_R64.CPP tests
21 #include <e32def_private.h>
25 LOCAL_C void MathException(TInt aErrType)
27 // Decides on type of maths exception according to error and raises exception.
28 // DOES NOT CONVERT TO SPECIAL IF RETURNS
29 // Added by AnnW, December 1996
33 TExcType excType=EExcGeneral;
37 case KErrArgument: // error due to invalid operation
38 excType=EExcFloatInvalidOperation;
40 case KErrDivideByZero:
41 excType=EExcFloatDivideByZero;
44 excType=EExcFloatOverflow;
47 excType=EExcFloatUnderflow;
50 // also errors due to inexact result
51 case KErrInexact: // const not defined yet
52 excType=EExcFloatInexact;
58 User::Panic(_L("USER-Math"),EMathUnknownError);
62 thread.RaiseException(excType);
65 GLDEF_C TReal64 __adddf3(TReal64 a1,TReal64 a2)
77 TInt ret=res.GetTReal(trg);
84 GLDEF_C TReal64 __subdf3(TReal64 a1,TReal64 a2)
86 // Subtract two doubles
96 TInt ret=res.GetTReal(trg);
103 GLDEF_C TReal64 __muldf3(TReal64 a1,TReal64 a2)
105 // Multiply two doubles
114 TInt ret=x1.Mult(res,x2);
116 ret=res.GetTReal(trg);
120 return((TReal64)res);
123 GLDEF_C TReal64 __divdf3(TReal64 a1,TReal64 a2)
125 // Divide two doubles
134 TInt ret=x1.Div(res,x2);
136 ret=res.GetTReal(trg);
140 return((TReal64)res);