00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __wcecompat__FLOAT_H__
00023 #define __wcecompat__FLOAT_H__
00024
00025 #include "stddef.h"
00026
00027 #ifdef __cplusplus
00028 extern "C" {
00029 #endif
00030
00031 #define DBL_DIG 15
00032 #define DBL_EPSILON 2.2204460492503131e-016
00033 #define DBL_MANT_DIG 53
00034 #define DBL_MAX 1.7976931348623158e+308
00035 #define DBL_MAX_10_EXP 308
00036 #define DBL_MAX_EXP 1024
00037 #define DBL_MIN 2.2250738585072014e-308
00038 #define DBL_MIN_10_EXP (-307)
00039 #define DBL_MIN_EXP (-1021)
00040 #define _DBL_RADIX 2
00041 #define _DBL_ROUNDS 1
00042
00043 #define FLT_DIG 6
00044 #define FLT_EPSILON 1.192092896e-07F
00045 #define FLT_GUARD 0
00046 #define FLT_MANT_DIG 24
00047 #define FLT_MAX 3.402823466e+38F
00048 #define FLT_MAX_10_EXP 38
00049 #define FLT_MAX_EXP 128
00050 #define FLT_MIN 1.175494351e-38F
00051 #define FLT_MIN_10_EXP (-37)
00052 #define FLT_MIN_EXP (-125)
00053 #define FLT_NORMALIZE 0
00054 #define FLT_RADIX 2
00055 #define FLT_ROUNDS 1
00056
00057 #define LDBL_DIG DBL_DIG
00058 #define LDBL_EPSILON DBL_EPSILON
00059 #define LDBL_MANT_DIG DBL_MANT_DIG
00060 #define LDBL_MAX DBL_MAX
00061 #define LDBL_MAX_10_EXP DBL_MAX_10_EXP
00062 #define LDBL_MAX_EXP DBL_MAX_EXP
00063 #define LDBL_MIN DBL_MIN
00064 #define LDBL_MIN_10_EXP DBL_MIN_10_EXP
00065 #define LDBL_MIN_EXP DBL_MIN_EXP
00066 #define _LDBL_RADIX DBL_RADIX
00067 #define _LDBL_ROUNDS DBL_ROUNDS
00068
00069
00070 #define _MCW_EM 0x0008001f
00071 #define _EM_INEXACT 0x00000001
00072 #define _EM_UNDERFLOW 0x00000002
00073 #define _EM_OVERFLOW 0x00000004
00074 #define _EM_ZERODIVIDE 0x00000008
00075 #define _EM_INVALID 0x00000010
00076 #define _MCW_RC 0x00000300
00077 #define _RC_NEAR 0x00000000
00078 #define _RC_DOWN 0x00000100
00079 #define _RC_UP 0x00000200
00080 #define _RC_CHOP 0x00000300
00081
00082
00083 #define _SW_INEXACT 0x00000001
00084 #define _SW_UNDERFLOW 0x00000002
00085 #define _SW_OVERFLOW 0x00000004
00086 #define _SW_ZERODIVIDE 0x00000008
00087 #define _SW_INVALID 0x00000010
00088
00089 #if ! defined (_M_CEE)
00090
00091
00092 #define _MCW_PC 0x00030000
00093 #define _PC_64 0x00000000
00094 #define _PC_53 0x00010000
00095 #define _PC_24 0x00020000
00096 #define _MCW_IC 0x00040000
00097 #define _IC_AFFINE 0x00040000
00098 #define _IC_PROJECTIVE 0x00000000
00099 #define _EM_DENORMAL 0x00080000
00100 #define _SW_DENORMAL 0x00080000
00101
00102
00103 #ifdef _M_SH
00104 #define _MCW_DN 0x00040000
00105 #define _DN_FLUSH 0x00040000
00106 #else
00107 #define _MCW_DN 0x01000000
00108 #define _DN_FLUSH 0x01000000
00109 #endif
00110 #define _DN_SAVE 0x00000000
00111
00112
00113
00114 #ifdef _M_IX86
00115 #define _CW_DEFAULT ( _RC_NEAR + _PC_64 + _EM_INVALID + _EM_ZERODIVIDE + _EM_OVERFLOW + _EM_UNDERFLOW + _EM_INEXACT )
00116 #else
00117 #define _CW_DEFAULT ( _RC_NEAR + _PC_53 + _EM_INVALID + _EM_ZERODIVIDE + _EM_OVERFLOW + _EM_UNDERFLOW + _EM_INEXACT )
00118 #endif
00119 #endif // ! _M_CEE
00120
00121
00122 #define _SW_UNEMULATED 0x0040
00123 #define _SW_SQRTNEG 0x0080
00124 #define _SW_STACKOVERFLOW 0x0200
00125 #define _SW_STACKUNDERFLOW 0x0400
00126
00127
00128 #define _FPE_INVALID 0x81
00129 #define _FPE_DENORMAL 0x82
00130 #define _FPE_ZERODIVIDE 0x83
00131 #define _FPE_OVERFLOW 0x84
00132 #define _FPE_UNDERFLOW 0x85
00133 #define _FPE_INEXACT 0x86
00134 #define _FPE_UNEMULATED 0x87
00135 #define _FPE_SQRTNEG 0x88
00136 #define _FPE_STACKOVERFLOW 0x8a
00137 #define _FPE_STACKUNDERFLOW 0x8b
00138 #define _FPE_EXPLICITGEN 0x8c
00139
00140
00141 unsigned int __cdecl _clearfp(void);
00142 unsigned int __cdecl _controlfp(unsigned int,unsigned int);
00143 unsigned int __cdecl _statusfp(void);
00144 void __cdecl _fpreset(void);
00145 #define _clear87 _clearfp
00146 #define _status87 _statusfp
00147
00148
00149 double __cdecl _copysign (double, double);
00150 double __cdecl _chgsign (double);
00151 double __cdecl _scalb(double, long);
00152 double __cdecl _logb(double);
00153 double __cdecl _nextafter(double, double);
00154 int __cdecl _finite(double);
00155 int __cdecl _isnan(double);
00156 int __cdecl _fpclass(double);
00157
00158 #define _FPCLASS_SNAN 0x0001
00159 #define _FPCLASS_QNAN 0x0002
00160 #define _FPCLASS_NINF 0x0004
00161 #define _FPCLASS_NN 0x0008
00162 #define _FPCLASS_ND 0x0010
00163 #define _FPCLASS_NZ 0x0020
00164 #define _FPCLASS_PZ 0x0040
00165 #define _FPCLASS_PD 0x0080
00166 #define _FPCLASS_PN 0x0100
00167 #define _FPCLASS_PINF 0x0200
00168
00169 typedef float _FP32;
00170 typedef double _FP64;
00171 typedef short _I16;
00172 typedef int _I32;
00173 typedef unsigned short _U16;
00174 typedef unsigned int _U32;
00175
00176 typedef struct {
00177 unsigned long W[4];
00178 } _U32ARRAY;
00179
00180 typedef struct {
00181 unsigned short W[5];
00182 } _FP80;
00183
00184 typedef struct {
00185 unsigned long W[4];
00186 } _FP128;
00187
00188 typedef struct {
00189 unsigned long W[2];
00190 } _I64;
00191
00192 typedef struct {
00193 unsigned long W[2];
00194 } _U64;
00195
00196 typedef struct {
00197 unsigned short W[5];
00198 } _BCD80;
00199
00200 typedef struct {
00201 union {
00202 _FP32 Fp32Value;
00203 _FP64 Fp64Value;
00204 _FP80 Fp80Value;
00205 _FP128 Fp128Value;
00206 _I16 I16Value;
00207 _I32 I32Value;
00208 _I64 I64Value;
00209 _U16 U16Value;
00210 _U32 U32Value;
00211 _U64 U64Value;
00212 _BCD80 Bcd80Value;
00213 char *StringValue;
00214 int CompareValue;
00215 _U32ARRAY U32ArrayValue;
00216 } Value;
00217 unsigned int OperandValid : 1;
00218 unsigned int Format : 4;
00219 } _FPIEEE_VALUE;
00220
00221 typedef struct {
00222 unsigned int Inexact : 1;
00223 unsigned int Underflow : 1;
00224 unsigned int Overflow : 1;
00225 unsigned int ZeroDivide : 1;
00226 unsigned int InvalidOperation : 1;
00227 } _FPIEEE_EXCEPTION_FLAGS;
00228
00229 typedef struct {
00230 unsigned int RoundingMode : 2;
00231 unsigned int Precision : 3;
00232 unsigned int Operation :12;
00233 _FPIEEE_EXCEPTION_FLAGS Cause;
00234 _FPIEEE_EXCEPTION_FLAGS Enable;
00235 _FPIEEE_EXCEPTION_FLAGS Status;
00236 _FPIEEE_VALUE Operand1;
00237 _FPIEEE_VALUE Operand2;
00238 _FPIEEE_VALUE Result;
00239 } _FPIEEE_RECORD;
00240
00241 typedef struct _EXCEPTION_POINTERS *PEXCEPTION_POINTERS;
00242
00243 #ifdef _WIN32_WCE_EMULATION
00244 int __cdecl _fpieee_flt(unsigned long exc_code, PEXCEPTION_POINTERS p, int handler(_FPIEEE_RECORD *));
00245 #else
00246 int _fpieee_flt(unsigned long exc_code, PEXCEPTION_POINTERS p, int handler(_FPIEEE_RECORD *));
00247 #endif
00248
00249
00250 #define DBL_RADIX _DBL_RADIX
00251 #define DBL_ROUNDS _DBL_ROUNDS
00252 #define LDBL_RADIX _LDBL_RADIX
00253 #define LDBL_ROUNDS _LDBL_ROUNDS
00254 #define MCW_EM _MCW_EM
00255 #define EM_INVALID _EM_INVALID
00256 #define EM_ZERODIVIDE _EM_ZERODIVIDE
00257 #define EM_OVERFLOW _EM_OVERFLOW
00258 #define EM_UNDERFLOW _EM_UNDERFLOW
00259 #define EM_INEXACT _EM_INEXACT
00260
00261 #if ! defined (_M_CEE)
00262
00263 #define EM_DENORMAL _EM_DENORMAL
00264 #define SW_DENORMAL _SW_DENORMAL
00265 #define MCW_IC _MCW_IC
00266 #define IC_AFFINE _IC_AFFINE
00267 #define IC_PROJECTIVE _IC_PROJECTIVE
00268 #define MCW_PC _MCW_PC
00269 #define PC_24 _PC_24
00270 #define PC_53 _PC_53
00271 #define PC_64 _PC_64
00272
00273 #endif // ! _M_CEE
00274
00275 #define MCW_RC _MCW_RC
00276 #define RC_CHOP _RC_CHOP
00277 #define RC_UP _RC_UP
00278 #define RC_DOWN _RC_DOWN
00279 #define RC_NEAR _RC_NEAR
00280 #define CW_DEFAULT _CW_DEFAULT
00281 #define SW_INVALID _SW_INVALID
00282 #define SW_ZERODIVIDE _SW_ZERODIVIDE
00283 #define SW_OVERFLOW _SW_OVERFLOW
00284 #define SW_UNDERFLOW _SW_UNDERFLOW
00285 #define SW_INEXACT _SW_INEXACT
00286 #define SW_UNEMULATED _SW_UNEMULATED
00287 #define SW_SQRTNEG _SW_SQRTNEG
00288 #define SW_STACKOVERFLOW _SW_STACKOVERFLOW
00289 #define SW_STACKUNDERFLOW _SW_STACKUNDERFLOW
00290 #define FPE_INVALID _FPE_INVALID
00291 #define FPE_DENORMAL _FPE_DENORMAL
00292 #define FPE_ZERODIVIDE _FPE_ZERODIVIDE
00293 #define FPE_OVERFLOW _FPE_OVERFLOW
00294 #define FPE_UNDERFLOW _FPE_UNDERFLOW
00295 #define FPE_INEXACT _FPE_INEXACT
00296 #define FPE_UNEMULATED _FPE_UNEMULATED
00297 #define FPE_SQRTNEG _FPE_SQRTNEG
00298 #define FPE_STACKOVERFLOW _FPE_STACKOVERFLOW
00299 #define FPE_STACKUNDERFLOW _FPE_STACKUNDERFLOW
00300 #define FPE_EXPLICITGEN _FPE_EXPLICITGEN
00301
00302 #ifdef _WIN32_WCE_EMULATION
00303 double __cdecl _frnd(double);
00304 double __cdecl _fsqrt(double);
00305 #else
00306 double _frnd(double);
00307 double _fsqrt(double);
00308 #endif
00309
00310
00311
00312 struct _complex {
00313 double x,y;
00314 } ;
00315
00316
00317 #define complex _complex
00318
00319
00320
00321
00322 _CRTIMP
00323 extern double _HUGE;
00324 #define HUGE_VAL _HUGE
00325
00326 #ifdef __cplusplus
00327 }
00328 #endif
00329
00330 #endif