Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

213 lines
7.1 KiB

  1. /***
  2. *float.h - constants for floating point values
  3. *
  4. * Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This file contains defines for a number of implementation dependent
  8. * values which are commonly used by sophisticated numerical (floating
  9. * point) programs.
  10. * [ANSI]
  11. *
  12. ****/
  13. #ifndef _INC_FLOAT
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #if (_MSC_VER <= 600)
  18. #define __cdecl _cdecl
  19. #define __far _far
  20. #endif
  21. #define DBL_DIG 15 /* # of decimal digits of precision */
  22. #define DBL_EPSILON 2.2204460492503131e-016 /* smallest such that 1.0+DBL_EPSILON != 1.0 */
  23. #define DBL_MANT_DIG 53 /* # of bits in mantissa */
  24. #define DBL_MAX 1.7976931348623158e+308 /* max value */
  25. #define DBL_MAX_10_EXP 308 /* max decimal exponent */
  26. #define DBL_MAX_EXP 1024 /* max binary exponent */
  27. #define DBL_MIN 2.2250738585072014e-308 /* min positive value */
  28. #define DBL_MIN_10_EXP (-307) /* min decimal exponent */
  29. #define DBL_MIN_EXP (-1021) /* min binary exponent */
  30. #define _DBL_RADIX 2 /* exponent radix */
  31. #define _DBL_ROUNDS 1 /* addition rounding: near */
  32. #define FLT_DIG 6 /* # of decimal digits of precision */
  33. #define FLT_EPSILON 1.192092896e-07F /* smallest such that 1.0+FLT_EPSILON != 1.0 */
  34. #define FLT_GUARD 0
  35. #define FLT_MANT_DIG 24 /* # of bits in mantissa */
  36. #define FLT_MAX 3.402823466e+38F /* max value */
  37. #define FLT_MAX_10_EXP 38 /* max decimal exponent */
  38. #define FLT_MAX_EXP 128 /* max binary exponent */
  39. #define FLT_MIN 1.175494351e-38F /* min positive value */
  40. #define FLT_MIN_10_EXP (-37) /* min decimal exponent */
  41. #define FLT_MIN_EXP (-125) /* min binary exponent */
  42. #define FLT_NORMALIZE 0
  43. #define FLT_RADIX 2 /* exponent radix */
  44. #define FLT_ROUNDS 1 /* addition rounding: near */
  45. #define LDBL_DIG 18 /* # of decimal digits of precision */
  46. #define LDBL_EPSILON 1.084202172485504434e-019L /* smallest such that 1.0+LDBL_EPSILON != 1.0 */
  47. #define LDBL_MANT_DIG 64 /* # of bits in mantissa */
  48. #define LDBL_MAX 1.189731495357231765e+4932L /* max value */
  49. #define LDBL_MAX_10_EXP 4932 /* max decimal exponent */
  50. #define LDBL_MAX_EXP 16384 /* max binary exponent */
  51. #define LDBL_MIN 3.3621031431120935063e-4932L /* min positive value */
  52. #define LDBL_MIN_10_EXP (-4931) /* min decimal exponent */
  53. #define LDBL_MIN_EXP (-16381) /* min binary exponent */
  54. #define _LDBL_RADIX 2 /* exponent radix */
  55. #define _LDBL_ROUNDS 1 /* addition rounding: near */
  56. /*
  57. * 8087/80287 math control information
  58. */
  59. /* User Control Word Mask and bit definitions.
  60. * These definitions match the 8087/80287
  61. */
  62. #define _MCW_EM 0x003f /* interrupt Exception Masks */
  63. #define _EM_INVALID 0x0001 /* invalid */
  64. #define _EM_DENORMAL 0x0002 /* denormal */
  65. #define _EM_ZERODIVIDE 0x0004 /* zero divide */
  66. #define _EM_OVERFLOW 0x0008 /* overflow */
  67. #define _EM_UNDERFLOW 0x0010 /* underflow */
  68. #define _EM_INEXACT 0x0020 /* inexact (precision) */
  69. #define _MCW_IC 0x1000 /* Infinity Control */
  70. #define _IC_AFFINE 0x1000 /* affine */
  71. #define _IC_PROJECTIVE 0x0000 /* projective */
  72. #define _MCW_RC 0x0c00 /* Rounding Control */
  73. #define _RC_CHOP 0x0c00 /* chop */
  74. #define _RC_UP 0x0800 /* up */
  75. #define _RC_DOWN 0x0400 /* down */
  76. #define _RC_NEAR 0x0000 /* near */
  77. #define _MCW_PC 0x0300 /* Precision Control */
  78. #define _PC_24 0x0000 /* 24 bits */
  79. #define _PC_53 0x0200 /* 53 bits */
  80. #define _PC_64 0x0300 /* 64 bits */
  81. /* initial Control Word value */
  82. #define _CW_DEFAULT ( _IC_AFFINE + _RC_NEAR + _PC_64 + _EM_DENORMAL + _EM_UNDERFLOW + _EM_INEXACT )
  83. /* user Status Word bit definitions */
  84. #define _SW_INVALID 0x0001 /* invalid */
  85. #define _SW_DENORMAL 0x0002 /* denormal */
  86. #define _SW_ZERODIVIDE 0x0004 /* zero divide */
  87. #define _SW_OVERFLOW 0x0008 /* overflow */
  88. #define _SW_UNDERFLOW 0x0010 /* underflow */
  89. #define _SW_INEXACT 0x0020 /* inexact (precision) */
  90. /* invalid subconditions (_SW_INVALID also set) */
  91. #define _SW_UNEMULATED 0x0040 /* unemulated instruction */
  92. #define _SW_SQRTNEG 0x0080 /* square root of a neg number */
  93. #define _SW_STACKOVERFLOW 0x0200 /* FP stack overflow */
  94. #define _SW_STACKUNDERFLOW 0x0400 /* FP stack underflow */
  95. /* Floating point error signals and return codes */
  96. #define _FPE_INVALID 0x81
  97. #define _FPE_DENORMAL 0x82
  98. #define _FPE_ZERODIVIDE 0x83
  99. #define _FPE_OVERFLOW 0x84
  100. #define _FPE_UNDERFLOW 0x85
  101. #define _FPE_INEXACT 0x86
  102. #define _FPE_UNEMULATED 0x87
  103. #define _FPE_SQRTNEG 0x88
  104. #define _FPE_STACKOVERFLOW 0x8a
  105. #define _FPE_STACKUNDERFLOW 0x8b
  106. #define _FPE_EXPLICITGEN 0x8c /* raise( SIGFPE ); */
  107. /* function prototypes */
  108. unsigned int __cdecl _clear87(void);
  109. unsigned int __cdecl _control87(unsigned int, unsigned int);
  110. void __cdecl _fpreset(void);
  111. unsigned int __cdecl _status87(void);
  112. #ifndef __STDC__
  113. /* Non-ANSI names for compatibility */
  114. #define DBL_RADIX _DBL_RADIX
  115. #define DBL_ROUNDS _DBL_ROUNDS
  116. #define LDBL_RADIX _LDBL_RADIX
  117. #define LDBL_ROUNDS _LDBL_ROUNDS
  118. #define MCW_EM _MCW_EM
  119. #define EM_INVALID _EM_INVALID
  120. #define EM_DENORMAL _EM_DENORMAL
  121. #define EM_ZERODIVIDE _EM_ZERODIVIDE
  122. #define EM_OVERFLOW _EM_OVERFLOW
  123. #define EM_UNDERFLOW _EM_UNDERFLOW
  124. #define EM_INEXACT _EM_INEXACT
  125. #define MCW_IC _MCW_IC
  126. #define IC_AFFINE _IC_AFFINE
  127. #define IC_PROJECTIVE _IC_PROJECTIVE
  128. #define MCW_RC _MCW_RC
  129. #define RC_CHOP _RC_CHOP
  130. #define RC_UP _RC_UP
  131. #define RC_DOWN _RC_DOWN
  132. #define RC_NEAR _RC_NEAR
  133. #define MCW_PC _MCW_PC
  134. #define PC_24 _PC_24
  135. #define PC_53 _PC_53
  136. #define PC_64 _PC_64
  137. #define CW_DEFAULT _CW_DEFAULT
  138. #define SW_INVALID _SW_INVALID
  139. #define SW_DENORMAL _SW_DENORMAL
  140. #define SW_ZERODIVIDE _SW_ZERODIVIDE
  141. #define SW_OVERFLOW _SW_OVERFLOW
  142. #define SW_UNDERFLOW _SW_UNDERFLOW
  143. #define SW_INEXACT _SW_INEXACT
  144. #define SW_UNEMULATED _SW_UNEMULATED
  145. #define SW_SQRTNEG _SW_SQRTNEG
  146. #define SW_STACKOVERFLOW _SW_STACKOVERFLOW
  147. #define SW_STACKUNDERFLOW _SW_STACKUNDERFLOW
  148. #define FPE_INVALID _FPE_INVALID
  149. #define FPE_DENORMAL _FPE_DENORMAL
  150. #define FPE_ZERODIVIDE _FPE_ZERODIVIDE
  151. #define FPE_OVERFLOW _FPE_OVERFLOW
  152. #define FPE_UNDERFLOW _FPE_UNDERFLOW
  153. #define FPE_INEXACT _FPE_INEXACT
  154. #define FPE_UNEMULATED _FPE_UNEMULATED
  155. #define FPE_SQRTNEG _FPE_SQRTNEG
  156. #define FPE_STACKOVERFLOW _FPE_STACKOVERFLOW
  157. #define FPE_STACKUNDERFLOW _FPE_STACKUNDERFLOW
  158. #define FPE_EXPLICITGEN _FPE_EXPLICITGEN
  159. #endif
  160. #ifdef __cplusplus
  161. }
  162. #endif
  163. #define _INC_FLOAT
  164. #endif