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.

137 lines
5.9 KiB

  1. /***
  2. *float.h - constants for floating point values
  3. *
  4. * Copyright (c) 1985-1988, 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 NO_EXT_KEYS /* extensions enabled */
  14. #define _CDECL cdecl
  15. #else /* extensions not enabled */
  16. #define _CDECL
  17. #endif /* NO_EXT_KEYS */
  18. #define DBL_DIG 15 /* # of decimal digits of precision */
  19. #define DBL_EPSILON 2.2204460492503131e-016 /* smallest such that 1.0+DBL_EPSILON != 1.0 */
  20. #define DBL_MANT_DIG 53 /* # of bits in mantissa */
  21. #define DBL_MAX 1.7976931348623158e+308 /* max value */
  22. #define DBL_MAX_10_EXP 308 /* max decimal exponent */
  23. #define DBL_MAX_EXP 1024 /* max binary exponent */
  24. #define DBL_MIN 2.2250738585072014e-308 /* min positive value */
  25. #define DBL_MIN_10_EXP -307 /* min decimal exponent
  26. #define DBL_MIN_EXP -1021 /* min binary exponent */
  27. #define DBL_RADIX 2 /* exponent radix */
  28. #define DBL_ROUNDS 0 /* addition rounding: chops */
  29. #define FLT_DIG 6 /* # of decimal digits of precision */
  30. #define FLT_EPSILON 1.192092896e-07 /* smallest such that 1.0+FLT_EPSILON != 1.0 */
  31. #define FLT_GUARD 0
  32. #define FLT_MANT_DIG 24 /* # of bits in mantissa */
  33. #define FLT_MAX 3.402823466e+38 /* max value */
  34. #define FLT_MAX_10_EXP 38 /* max decimal exponent */
  35. #define FLT_MAX_EXP 128 /* max binary exponent */
  36. #define FLT_MIN 1.175494351e-38 /* min positive value */
  37. #define FLT_MIN_10_EXP -37 /* min decimal exponent */
  38. #define FLT_MIN_EXP -125 /* min binary exponent */
  39. #define FLT_NORMALIZE 0
  40. #define FLT_RADIX 2 /* exponent radix */
  41. #define FLT_ROUNDS 0 /* addition rounding: chops */
  42. #define LDBL_DIG DBL_DIG /* # of decimal digits of precision */
  43. #define LDBL_EPSILON DBL_EPSILON /* smallest such that 1.0+LDBL_EPSILON != 1.0 */
  44. #define LDBL_MANT_DIG DBL_MANT_DIG /* # of bits in mantissa */
  45. #define LDBL_MAX DBL_MAX /* max value */
  46. #define LDBL_MAX_10_EXP DBL_MAX_10_EXP /* max decimal exponent */
  47. #define LDBL_MAX_EXP DBL_MAX_EXP /* max binary exponent */
  48. #define LDBL_MIN DBL_MIN /* min positive value */
  49. #define LDBL_MIN_10_EXP DBL_MIN_10_EXP /* min deimal exponent
  50. #define LDBL_MIN_EXP DBL_MIN_EXP /* min binary exponent */
  51. #define LDBL_RADIX DBL_RADIX /* exponent radix */
  52. #define LDBL_ROUNDS DBL_ROUNDS /* addition rounding: chops */
  53. /*
  54. * 8087/80287 math control information
  55. */
  56. /* User Control Word Mask and bit definitions.
  57. * These definitions match the 8087/80287
  58. */
  59. #define MCW_EM 0x003f /* interrupt Exception Masks */
  60. #define EM_INVALID 0x0001 /* invalid */
  61. #define EM_DENORMAL 0x0002 /* denormal */
  62. #define EM_ZERODIVIDE 0x0004 /* zero divide */
  63. #define EM_OVERFLOW 0x0008 /* overflow */
  64. #define EM_UNDERFLOW 0x0010 /* underflow */
  65. #define EM_INEXACT 0x0020 /* inexact (precision) */
  66. #define MCW_IC 0x1000 /* Infinity Control */
  67. #define IC_AFFINE 0x1000 /* affine */
  68. #define IC_PROJECTIVE 0x0000 /* projective */
  69. #define MCW_RC 0x0c00 /* Rounding Control */
  70. #define RC_CHOP 0x0c00 /* chop */
  71. #define RC_UP 0x0800 /* up */
  72. #define RC_DOWN 0x0400 /* down */
  73. #define RC_NEAR 0x0000 /* near */
  74. #define MCW_PC 0x0300 /* Precision Control */
  75. #define PC_24 0x0000 /* 24 bits */
  76. #define PC_53 0x0200 /* 53 bits */
  77. #define PC_64 0x0300 /* 64 bits */
  78. /* initial Control Word value */
  79. #define CW_DEFAULT ( IC_AFFINE + RC_NEAR + PC_64 + EM_DENORMAL + EM_UNDERFLOW + EM_INEXACT )
  80. /* user Status Word bit definitions */
  81. #define SW_INVALID 0x0001 /* invalid */
  82. #define SW_DENORMAL 0x0002 /* denormal */
  83. #define SW_ZERODIVIDE 0x0004 /* zero divide */
  84. #define SW_OVERFLOW 0x0008 /* overflow */
  85. #define SW_UNDERFLOW 0x0010 /* underflow */
  86. #define SW_INEXACT 0x0020 /* inexact (precision) */
  87. /* invalid subconditions (SW_INVALID also set) */
  88. #define SW_UNEMULATED 0x0040 /* unemulated instruction */
  89. #define SW_SQRTNEG 0x0080 /* square root of a neg number */
  90. #define SW_STACKOVERFLOW 0x0200 /* FP stack overflow */
  91. #define SW_STACKUNDERFLOW 0x0400 /* FP stack underflow */
  92. /* Floating point error signals and return codes */
  93. #define FPE_INVALID 0x81
  94. #define FPE_DENORMAL 0x82
  95. #define FPE_ZERODIVIDE 0x83
  96. #define FPE_OVERFLOW 0x84
  97. #define FPE_UNDERFLOW 0x85
  98. #define FPE_INEXACT 0x86
  99. #define FPE_UNEMULATED 0x87
  100. #define FPE_SQRTNEG 0x88
  101. #define FPE_STACKOVERFLOW 0x8a
  102. #define FPE_STACKUNDERFLOW 0x8b
  103. #define FPE_EXPLICITGEN 0x8c /* raise( SIGFPE ); */
  104. /* function prototypes */
  105. unsigned int _CDECL _clear87(void);
  106. unsigned int _CDECL _control87(unsigned int,unsigned int);
  107. void _CDECL _fpreset(void);
  108. unsigned int _CDECL _status87(void);