Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenfloat.h
Go to the documentation of this file.
00001 /* 00002 * float.h 00003 * This file has no copyright assigned and is placed in the Public Domain. 00004 * This file is a part of the mingw-runtime package. 00005 * No warranty is given; refer to the file DISCLAIMER within the package. 00006 * 00007 * Constants related to floating point arithmetic. 00008 * 00009 * Also included here are some non-ANSI bits for accessing the floating 00010 * point controller. 00011 * 00012 * NOTE: GCC provides float.h, but it doesn't include the non-standard 00013 * stuff for accessing the fp controller. We include_next the 00014 * GCC-supplied header and just define the MS-specific extensions 00015 * here. 00016 * 00017 */ 00018 #ifdef __GNUC__ 00019 #include_next <float.h> 00020 #endif 00021 #ifndef _MINGW_FLOAT_H_ 00022 #define _MINGW_FLOAT_H_ 00023 00024 /* All the headers include this file. */ 00025 #ifdef __GNUC__ 00026 #include <_mingw.h> 00027 #endif 00028 /* 00029 * Functions and definitions for controlling the FPU. 00030 */ 00031 #ifndef __STRICT_ANSI__ 00032 00033 /* TODO: These constants are only valid for x86 machines */ 00034 00035 /* Control word masks for unMask */ 00036 #define _MCW_EM 0x0008001F /* Error masks */ 00037 #define _MCW_IC 0x00040000 /* Infinity */ 00038 #define _MCW_RC 0x00000300 /* Rounding */ 00039 #define _MCW_PC 0x00030000 /* Precision */ 00040 00041 /* Control word values for unNew (use with related unMask above) */ 00042 #define _EM_INVALID 0x00000010 00043 #define _EM_DENORMAL 0x00080000 00044 #define _EM_ZERODIVIDE 0x00000008 00045 #define _EM_OVERFLOW 0x00000004 00046 #define _EM_UNDERFLOW 0x00000002 00047 #define _EM_INEXACT 0x00000001 00048 #define _IC_AFFINE 0x00040000 00049 #define _IC_PROJECTIVE 0x00000000 00050 #define _RC_CHOP 0x00000300 00051 #define _RC_UP 0x00000200 00052 #define _RC_DOWN 0x00000100 00053 #define _RC_NEAR 0x00000000 00054 #define _PC_24 0x00020000 00055 #define _PC_53 0x00010000 00056 #define _PC_64 0x00000000 00057 00058 /* These are also defined in Mingw math.h, needed to work around 00059 GCC build issues. */ 00060 /* Return values for fpclass. */ 00061 #ifndef __MINGW_FPCLASS_DEFINED 00062 #define __MINGW_FPCLASS_DEFINED 1 00063 #define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */ 00064 #define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */ 00065 #define _FPCLASS_NINF 0x0004 /* Negative Infinity */ 00066 #define _FPCLASS_NN 0x0008 /* Negative Normal */ 00067 #define _FPCLASS_ND 0x0010 /* Negative Denormal */ 00068 #define _FPCLASS_NZ 0x0020 /* Negative Zero */ 00069 #define _FPCLASS_PZ 0x0040 /* Positive Zero */ 00070 #define _FPCLASS_PD 0x0080 /* Positive Denormal */ 00071 #define _FPCLASS_PN 0x0100 /* Positive Normal */ 00072 #define _FPCLASS_PINF 0x0200 /* Positive Infinity */ 00073 #endif /* __MINGW_FPCLASS_DEFINED */ 00074 00075 /* _statusfp bit flags */ 00076 #define _SW_INEXACT 0x00000001 /* inexact (precision) */ 00077 #define _SW_UNDERFLOW 0x00000002 /* underflow */ 00078 #define _SW_OVERFLOW 0x00000004 /* overflow */ 00079 #define _SW_ZERODIVIDE 0x00000008 /* zero divide */ 00080 #define _SW_INVALID 0x00000010 /* invalid */ 00081 #define _SW_DENORMAL 0x00080000 /* denormal status bit */ 00082 00083 #define _SW_UNEMULATED 0x00000040 /* unemulated instruction */ 00084 #define _SW_SQRTNEG 0x00000080 /* square root of a neg number */ 00085 #define _SW_STACKOVERFLOW 0x00000200 /* FP stack overflow */ 00086 #define _SW_STACKUNDERFLOW 0x00000400 /* FP stack underflow */ 00087 00088 /* Floating point error signals and return codes */ 00089 #define _FPE_INVALID 0x81 00090 #define _FPE_DENORMAL 0x82 00091 #define _FPE_ZERODIVIDE 0x83 00092 #define _FPE_OVERFLOW 0x84 00093 #define _FPE_UNDERFLOW 0x85 00094 #define _FPE_INEXACT 0x86 00095 #define _FPE_UNEMULATED 0x87 00096 #define _FPE_SQRTNEG 0x88 00097 #define _FPE_STACKOVERFLOW 0x8a 00098 #define _FPE_STACKUNDERFLOW 0x8b 00099 #define _FPE_EXPLICITGEN 0x8c /* raise( SIGFPE ); */ 00100 00101 #ifndef DBL_MAX_10_EXP 00102 #define DBL_MAX_10_EXP 308 00103 #endif 00104 #ifndef UINT64_MAX 00105 #define UINT64_MAX 0xffffffffffffffff 00106 #endif 00107 00108 #ifndef RC_INVOKED 00109 00110 #ifdef __cplusplus 00111 extern "C" { 00112 #endif 00113 00114 #ifndef _CRTIMP 00115 #ifdef _DLL 00116 #define _CRTIMP __declspec(dllimport) 00117 #else 00118 #define _CRTIMP 00119 #endif /* _DLL */ 00120 #endif 00121 00122 /* Set the FPU control word as cw = (cw & ~unMask) | (unNew & unMask), 00123 * i.e. change the bits in unMask to have the values they have in unNew, 00124 * leaving other bits unchanged. */ 00125 _CRTIMP unsigned int __cdecl _controlfp (unsigned int unNew, unsigned int unMask); 00126 _CRTIMP unsigned int __cdecl _control87 (unsigned int unNew, unsigned int unMask); 00127 00128 00129 _CRTIMP unsigned int __cdecl _clearfp (void); /* Clear the FPU status word */ 00130 _CRTIMP unsigned int __cdecl _statusfp (void); /* Report the FPU status word */ 00131 #define _clear87 _clearfp 00132 #define _status87 _statusfp 00133 00134 00135 /* 00136 MSVCRT.dll _fpreset initializes the control register to 0x27f, 00137 the status register to zero and the tag word to 0FFFFh. 00138 This differs from asm instruction finit/fninit which set control 00139 word to 0x37f (64 bit mantissa precison rather than 53 bit). 00140 By default, the mingw version of _fpreset sets fp control as 00141 per fninit. To use the MSVCRT.dll _fpreset, include CRT_fp8.o when 00142 building your application. 00143 */ 00144 void __cdecl _fpreset (void); 00145 void __cdecl fpreset (void); 00146 00147 /* Global 'variable' for the current floating point error code. */ 00148 _CRTIMP int * __cdecl __fpecode(void); 00149 #define _fpecode (*(__fpecode())) 00150 00151 /* 00152 * IEEE recommended functions. MS puts them in float.h 00153 * but they really belong in math.h. 00154 */ 00155 00156 _CRTIMP double __cdecl _chgsign (double); 00157 _CRTIMP double __cdecl _copysign (double, double); 00158 _CRTIMP double __cdecl _logb (double); 00159 _CRTIMP double __cdecl _nextafter (double, double); 00160 _CRTIMP double __cdecl _scalb (double, long); 00161 00162 _CRTIMP int __cdecl _finite (double); 00163 _CRTIMP int __cdecl _fpclass (double); 00164 _CRTIMP int __cdecl _isnan (double); 00165 00166 #ifdef __cplusplus 00167 } 00168 #endif 00169 00170 #endif /* Not RC_INVOKED */ 00171 00172 #endif /* Not __STRICT_ANSI__ */ 00173 00174 #endif /* _FLOAT_H_ */ 00175 00176 Generated on Sun May 27 2012 04:28:46 for ReactOS by
1.7.6.1
|