epoc32/include/e32math.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    23 /**
    23 /**
    24 @publishedAll
    24 @publishedAll
    25 @released
    25 @released
    26 */
    26 */
    27 const TInt KMaxPrecision=15;
    27 const TInt KMaxPrecision=15;
    28 /**
    28 
    29 @publishedAll
    29 /**
    30 @released
    30 @publishedAll
       
    31 @released
       
    32 
       
    33 This constant specifies the maximum number of significant digits available with floating 
       
    34 point computations. Rounding and string formatting methods will not use more digits than this.
    31 */
    35 */
    32 const TInt KPrecisionLimit=12;
    36 const TInt KPrecisionLimit=12;
       
    37 
       
    38 /**
       
    39 @publishedAll
       
    40 @released
       
    41 
       
    42 Let D be the set of real numbers exactly representable by an IEEE-754 'double'
       
    43 For any positive integer n let X_n be the set of real numbers with an exact
       
    44 decimal representation using n significant digits.
       
    45 Let r_n : D -> X_n be defined by r_n(x)=y such that
       
    46 |y-x| = inf { |z-x| : z in X_n }
       
    47 and (in the case where two such y exist) that the last significant digit in the
       
    48 decimal representation of y is even.
       
    49 This constant is the least n such that r_n is injective.
       
    50 */
       
    51 const TInt KIEEEDoubleInjectivePrecision=17;
       
    52 
    33 /**
    53 /**
    34 @publishedAll
    54 @publishedAll
    35 @released
    55 @released
    36 */
    56 */
    37 const TInt KMantissaBits=53;
    57 const TInt KMantissaBits=53;
   453 	IMPORT_C static TInt Pow(TReal &aTrg,const TReal &aSrc,const TReal &aPower);
   473 	IMPORT_C static TInt Pow(TReal &aTrg,const TReal &aSrc,const TReal &aPower);
   454 	IMPORT_C static TInt Pow10(TReal &aTrg,const TInt exp);
   474 	IMPORT_C static TInt Pow10(TReal &aTrg,const TInt exp);
   455 	IMPORT_C static TInt Rand(TInt64 &aSeed);
   475 	IMPORT_C static TInt Rand(TInt64 &aSeed);
   456 	IMPORT_C static TReal FRand(TInt64 &aSeed) __SOFTFP;
   476 	IMPORT_C static TReal FRand(TInt64 &aSeed) __SOFTFP;
   457 	IMPORT_C static TUint32 Random();
   477 	IMPORT_C static TUint32 Random();
       
   478 	IMPORT_C static void Random(TDes8& aRandomValue);
       
   479 	IMPORT_C static void RandomL(TDes8& aRandomValue);
       
   480 	IMPORT_C static TUint32 RandomL();
   458 	IMPORT_C static TInt Round(TReal &aTrg,const TReal &aSrc,TInt aDecimalPlaces);
   481 	IMPORT_C static TInt Round(TReal &aTrg,const TReal &aSrc,TInt aDecimalPlaces);
   459 	IMPORT_C static TInt Sin(TReal &aTrg,const TReal &aSrc); 
   482 	IMPORT_C static TInt Sin(TReal &aTrg,const TReal &aSrc); 
   460 	IMPORT_C static TInt Sqrt(TReal &aTrg,const TReal &aSrc);
   483 	IMPORT_C static TInt Sqrt(TReal &aTrg,const TReal &aSrc);
   461 	IMPORT_C static TInt Tan(TReal &aTrg,const TReal &aSrc);
   484 	IMPORT_C static TInt Tan(TReal &aTrg,const TReal &aSrc);
   462 	IMPORT_C static TBool IsZero(const TReal &aVal);
   485 	IMPORT_C static TBool IsZero(const TReal &aVal);