|
|
1.1 ! root 1: /*** ! 2: *float.h - constants for floating point values ! 3: * ! 4: * Copyright (c) 1985-1991, 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: ! 14: #ifndef _INC_FLOAT ! 15: ! 16: #ifdef __cplusplus ! 17: extern "C" { ! 18: #endif ! 19: ! 20: ! 21: #if (_MSC_VER <= 600) ! 22: #define __cdecl _cdecl ! 23: #endif ! 24: ! 25: #define DBL_DIG 15 /* # of decimal digits of precision */ ! 26: #define DBL_EPSILON 2.2204460492503131e-016 /* smallest such that 1.0+DBL_EPSILON != 1.0 */ ! 27: #define DBL_MANT_DIG 53 /* # of bits in mantissa */ ! 28: #define DBL_MAX 1.7976931348623158e+308 /* max value */ ! 29: #define DBL_MAX_10_EXP 308 /* max decimal exponent */ ! 30: #define DBL_MAX_EXP 1024 /* max binary exponent */ ! 31: #define DBL_MIN 2.2250738585072014e-308 /* min positive value */ ! 32: #define DBL_MIN_10_EXP (-307) /* min decimal exponent */ ! 33: #define DBL_MIN_EXP (-1021) /* min binary exponent */ ! 34: #define _DBL_RADIX 2 /* exponent radix */ ! 35: #define _DBL_ROUNDS 1 /* addition rounding: near */ ! 36: ! 37: #define FLT_DIG 6 /* # of decimal digits of precision */ ! 38: #define FLT_EPSILON 1.192092896e-07F /* smallest such that 1.0+FLT_EPSILON != 1.0 */ ! 39: #define FLT_GUARD 0 ! 40: #define FLT_MANT_DIG 24 /* # of bits in mantissa */ ! 41: #define FLT_MAX 3.402823466e+38F /* max value */ ! 42: #define FLT_MAX_10_EXP 38 /* max decimal exponent */ ! 43: #define FLT_MAX_EXP 128 /* max binary exponent */ ! 44: #define FLT_MIN 1.175494351e-38F /* min positive value */ ! 45: #define FLT_MIN_10_EXP (-37) /* min decimal exponent */ ! 46: #define FLT_MIN_EXP (-125) /* min binary exponent */ ! 47: #define FLT_NORMALIZE 0 ! 48: #define FLT_RADIX 2 /* exponent radix */ ! 49: #define FLT_ROUNDS 1 /* addition rounding: near */ ! 50: ! 51: #define LDBL_DIG DBL_DIG /* # of decimal digits of precision */ ! 52: #define LDBL_EPSILON DBL_EPSILON /* smallest such that 1.0+LDBL_EPSILON != 1.0 */ ! 53: #define LDBL_MANT_DIG DBL_MANT_DIG /* # of bits in mantissa */ ! 54: #define LDBL_MAX DBL_MAX /* max value */ ! 55: #define LDBL_MAX_10_EXP DBL_MAX_10_EXP /* max decimal exponent */ ! 56: #define LDBL_MAX_EXP DBL_MAX_EXP /* max binary exponent */ ! 57: #define LDBL_MIN DBL_MIN /* min positive value */ ! 58: #define LDBL_MIN_10_EXP DBL_MIN_10_EXP /* min decimal exponent */ ! 59: #define LDBL_MIN_EXP DBL_MIN_EXP /* min binary exponent */ ! 60: #define _LDBL_RADIX DBL_RADIX /* exponent radix */ ! 61: #define _LDBL_ROUNDS DBL_ROUNDS /* addition rounding: near */ ! 62: ! 63: ! 64: ! 65: /* ! 66: * 8087/80287 math control information ! 67: */ ! 68: ! 69: ! 70: /* User Control Word Mask and bit definitions. ! 71: * These definitions match the 8087/80287 ! 72: */ ! 73: ! 74: #define _MCW_EM 0x003f /* interrupt Exception Masks */ ! 75: #define _EM_INVALID 0x0001 /* invalid */ ! 76: #define _EM_DENORMAL 0x0002 /* denormal */ ! 77: #define _EM_ZERODIVIDE 0x0004 /* zero divide */ ! 78: #define _EM_OVERFLOW 0x0008 /* overflow */ ! 79: #define _EM_UNDERFLOW 0x0010 /* underflow */ ! 80: #define _EM_INEXACT 0x0020 /* inexact (precision) */ ! 81: ! 82: #define _MCW_IC 0x1000 /* Infinity Control */ ! 83: #define _IC_AFFINE 0x1000 /* affine */ ! 84: #define _IC_PROJECTIVE 0x0000 /* projective */ ! 85: ! 86: #define _MCW_RC 0x0c00 /* Rounding Control */ ! 87: #define _RC_CHOP 0x0c00 /* chop */ ! 88: #define _RC_UP 0x0800 /* up */ ! 89: #define _RC_DOWN 0x0400 /* down */ ! 90: #define _RC_NEAR 0x0000 /* near */ ! 91: ! 92: #define _MCW_PC 0x0300 /* Precision Control */ ! 93: #define _PC_24 0x0000 /* 24 bits */ ! 94: #define _PC_53 0x0200 /* 53 bits */ ! 95: #define _PC_64 0x0300 /* 64 bits */ ! 96: ! 97: ! 98: /* initial Control Word value */ ! 99: ! 100: #define _CW_DEFAULT ( _IC_AFFINE + _RC_NEAR + _PC_64 + _EM_DENORMAL + _EM_UNDERFLOW + _EM_INEXACT ) ! 101: ! 102: ! 103: /* user Status Word bit definitions */ ! 104: ! 105: #define _SW_INVALID 0x0001 /* invalid */ ! 106: #define _SW_DENORMAL 0x0002 /* denormal */ ! 107: #define _SW_ZERODIVIDE 0x0004 /* zero divide */ ! 108: #define _SW_OVERFLOW 0x0008 /* overflow */ ! 109: #define _SW_UNDERFLOW 0x0010 /* underflow */ ! 110: #define _SW_INEXACT 0x0020 /* inexact (precision) */ ! 111: ! 112: ! 113: /* invalid subconditions (_SW_INVALID also set) */ ! 114: ! 115: #define _SW_UNEMULATED 0x0040 /* unemulated instruction */ ! 116: #define _SW_SQRTNEG 0x0080 /* square root of a neg number */ ! 117: #define _SW_STACKOVERFLOW 0x0200 /* FP stack overflow */ ! 118: #define _SW_STACKUNDERFLOW 0x0400 /* FP stack underflow */ ! 119: ! 120: ! 121: /* Global variable holding floating point error code */ ! 122: ! 123: #ifdef _MT ! 124: extern int * __fpecode(void); ! 125: #define _fpecode (*__fpecode()) ! 126: #else ! 127: extern int _fpecode; ! 128: #endif ! 129: ! 130: ! 131: /* Floating point error signals and return codes */ ! 132: ! 133: #define _FPE_INVALID 0x81 ! 134: #define _FPE_DENORMAL 0x82 ! 135: #define _FPE_ZERODIVIDE 0x83 ! 136: #define _FPE_OVERFLOW 0x84 ! 137: #define _FPE_UNDERFLOW 0x85 ! 138: #define _FPE_INEXACT 0x86 ! 139: ! 140: #define _FPE_UNEMULATED 0x87 ! 141: #define _FPE_SQRTNEG 0x88 ! 142: #define _FPE_STACKOVERFLOW 0x8a ! 143: #define _FPE_STACKUNDERFLOW 0x8b ! 144: ! 145: #define _FPE_EXPLICITGEN 0x8c /* raise( SIGFPE ); */ ! 146: ! 147: ! 148: /* function prototypes */ ! 149: ! 150: unsigned int _clear87(void); ! 151: unsigned int _control87(unsigned int,unsigned int); ! 152: void _fpreset(void); ! 153: unsigned int _status87(void); ! 154: ! 155: #if !__STDC__ ! 156: /* Non-ANSI names for compatibility */ ! 157: ! 158: #define DBL_RADIX _DBL_RADIX ! 159: #define DBL_ROUNDS _DBL_ROUNDS ! 160: ! 161: #define LDBL_RADIX _LDBL_RADIX ! 162: #define LDBL_ROUNDS _LDBL_ROUNDS ! 163: ! 164: #define MCW_EM _MCW_EM ! 165: #define EM_INVALID _EM_INVALID ! 166: #define EM_DENORMAL _EM_DENORMAL ! 167: #define EM_ZERODIVIDE _EM_ZERODIVIDE ! 168: #define EM_OVERFLOW _EM_OVERFLOW ! 169: #define EM_UNDERFLOW _EM_UNDERFLOW ! 170: #define EM_INEXACT _EM_INEXACT ! 171: ! 172: #define MCW_IC _MCW_IC ! 173: #define IC_AFFINE _IC_AFFINE ! 174: #define IC_PROJECTIVE _IC_PROJECTIVE ! 175: ! 176: #define MCW_RC _MCW_RC ! 177: #define RC_CHOP _RC_CHOP ! 178: #define RC_UP _RC_UP ! 179: #define RC_DOWN _RC_DOWN ! 180: #define RC_NEAR _RC_NEAR ! 181: ! 182: #define MCW_PC _MCW_PC ! 183: #define PC_24 _PC_24 ! 184: #define PC_53 _PC_53 ! 185: #define PC_64 _PC_64 ! 186: ! 187: #define CW_DEFAULT _CW_DEFAULT ! 188: ! 189: #define SW_INVALID _SW_INVALID ! 190: #define SW_DENORMAL _SW_DENORMAL ! 191: #define SW_ZERODIVIDE _SW_ZERODIVIDE ! 192: #define SW_OVERFLOW _SW_OVERFLOW ! 193: #define SW_UNDERFLOW _SW_UNDERFLOW ! 194: #define SW_INEXACT _SW_INEXACT ! 195: ! 196: #define SW_UNEMULATED _SW_UNEMULATED ! 197: #define SW_SQRTNEG _SW_SQRTNEG ! 198: #define SW_STACKOVERFLOW _SW_STACKOVERFLOW ! 199: #define SW_STACKUNDERFLOW _SW_STACKUNDERFLOW ! 200: ! 201: #define FPE_INVALID _FPE_INVALID ! 202: #define FPE_DENORMAL _FPE_DENORMAL ! 203: #define FPE_ZERODIVIDE _FPE_ZERODIVIDE ! 204: #define FPE_OVERFLOW _FPE_OVERFLOW ! 205: #define FPE_UNDERFLOW _FPE_UNDERFLOW ! 206: #define FPE_INEXACT _FPE_INEXACT ! 207: ! 208: #define FPE_UNEMULATED _FPE_UNEMULATED ! 209: #define FPE_SQRTNEG _FPE_SQRTNEG ! 210: #define FPE_STACKOVERFLOW _FPE_STACKOVERFLOW ! 211: #define FPE_STACKUNDERFLOW _FPE_STACKUNDERFLOW ! 212: ! 213: #define FPE_EXPLICITGEN _FPE_EXPLICITGEN ! 214: ! 215: #endif /* __STDC__ */ ! 216: ! 217: ! 218: #ifdef __cplusplus ! 219: } ! 220: #endif ! 221: ! 222: #define _INC_FLOAT ! 223: #endif /* _INC_FLOAT */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.