symport/e32test/math/t_math.h
changeset 1 0a7b44b10206
child 2 806186ab5e14
equal deleted inserted replaced
0:c55016431358 1:0a7b44b10206
       
     1 // Copyright (c) 1995-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 "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // e32test\math\t_math.h
       
    15 // Copy of e32\umath\um_std.h for E32\TMATH directory
       
    16 // 
       
    17 //
       
    18 
       
    19 
       
    20 #include <e32math.h>
       
    21 #include <e32std.h>
       
    22 #include <e32test.h>
       
    23 
       
    24 struct SReal32
       
    25     {
       
    26     unsigned man:23;
       
    27     unsigned exp:8;
       
    28     unsigned sign:1;
       
    29     };
       
    30 
       
    31 #if defined(__DOUBLE_WORDS_SWAPPED__)
       
    32 struct SReal64
       
    33     {
       
    34     unsigned msm:20;
       
    35     unsigned exp:11;
       
    36     unsigned sign:1;
       
    37     TUint lsm;
       
    38     };
       
    39 #define DVAL(m0,m1,m2,m3,e)     {(TUint)((m0<<16)|m1),e+KExponentBias,0,(TUint)((m2<<16)|m3)}
       
    40 #else
       
    41 struct SReal64
       
    42     {
       
    43     TUint lsm;
       
    44     unsigned msm:20;
       
    45     unsigned exp:11;
       
    46     unsigned sign:1;
       
    47     };
       
    48 #define DVAL(m0,m1,m2,m3,e)     {(TUint)((m2<<16)|m3),(TUint)((m0<<16)|m1),e+KExponentBias,0}
       
    49 #endif
       
    50 
       
    51 enum TMathPanic
       
    52     {
       
    53 	EMathDivideByZero,
       
    54 	EMathOverflow,
       
    55 	EMathUnderflow,
       
    56 	EMathBadOperand,
       
    57     EMathUnknownError
       
    58     };
       
    59 
       
    60 GLREF_C void Panic(TMathPanic aPanic);