First public contribution.
1 // Copyright (c) 1997-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 // e32\euser\epoc\arm\uc_realx.cpp
21 GLDEF_C void PanicOverUnderflowDividebyZero(const TInt aErr)
23 // Panics if there is an overflow or underflow or divide by zero
26 // if (aErr==KErrOverflow)
27 // Panic(EMathOverflow);
28 // if (aErr==KErrUnderflow)
29 // Panic(EMathUnderflow);
30 // if (aErr==KErrDivideByZero)
31 // Panic(EMathDivideByZero);
32 // if (aErr==KErrArgument)
33 // Panic(EMathBadOperand);
34 User::Panic(_L("MATHX"),aErr);
37 #ifdef __REALS_MACHINE_CODED__
38 extern "C" void __math_exception(TInt aErrType)
40 // Decides on type of maths exception according to error and raises exception.
41 // Added by AnnW, December 1996
45 TExcType excType=EExcGeneral;
49 case KErrArgument: // error due to invalid operation
50 excType=EExcFloatInvalidOperation;
52 case KErrDivideByZero:
53 excType=EExcFloatDivideByZero;
56 excType=EExcFloatOverflow;
59 excType=EExcFloatUnderflow;
62 // also errors due to inexact result
63 case KErrInexact: // const not defined yet
64 excType=EExcFloatInexact;
70 // Panic(EMathUnknownError);
71 User::Panic(_L("MATHX"),KErrGeneral);
74 User::RaiseException(excType);
82 EXPORT_C TRealX::TRealX()
84 Constructs a default extended precision object.
86 This sets the value to zero.
89 // Be Brutal (this should be as efficient as the naked versions)
90 TUint * me = (TUint *)this;
97 EXPORT_C TRealX::TRealX(TUint anExp, TUint aMantHi, TUint aMantLo)
99 Constructs an extended precision object from an explicit exponent and
102 @param anExp The exponent
103 @param aMantHi The high order 32 bits of the 64 bit mantissa
104 @param aMantLo The low order 32 bits of the 64 bit mantissa
107 // Be Brutal (this should be as efficient as the naked versions)
108 TUint * me = (TUint *)this;
117 EXPORT_C TRealX::TRealX(TInt anInt)
119 Constructs an extended precision object from a signed integer value.
121 @param anInt The signed integer value.
124 TRealX::operator=(anInt);
130 EXPORT_C TRealX::TRealX(const TInt64& anInt)
132 Constructs an extended precision object from a 64 bit integer.
134 @param anInt A reference to a 64 bit integer.
137 TRealX::operator=(anInt);
143 EXPORT_C TRealX::TRealX(TUint anInt)
145 Constructs an extended precision object from an unsigned integer value.
147 @param anInt The unsigned integer value.
150 TRealX::operator=(anInt);
156 EXPORT_C TRealX::TRealX(TReal32 aReal)__SOFTFP
158 Constructs an extended precision object from
159 a single precision floating point number.
161 @param aReal The single precision floating point value.
164 TRealX::operator=(aReal);
170 EXPORT_C TRealX::TRealX(TReal64 aReal)__SOFTFP
172 Constructs an extended precision object from
173 a double precision floating point number.
175 @param aReal The double precision floating point value.
178 TRealX::operator=(aReal);