Annotation of mstools/h/float.h, revision 1.1.1.3

1.1       root        1: /***
                      2: *float.h - constants for floating point values
                      3: *
1.1.1.3 ! root        4: *      Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved.
1.1       root        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: 
1.1.1.3 ! root       21: /*
        !            22:  * Conditional macro definition for function calling type and variable type
        !            23:  * qualifiers.
        !            24:  */
        !            25: #if   ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
        !            26: 
        !            27: /*
        !            28:  * Definitions for MS C8-32 (386/486) compiler
        !            29:  */
        !            30: #define _CRTAPI1 __cdecl
        !            31: #define _CRTAPI2 __cdecl
        !            32: 
        !            33: #elif ( _MSC_VER == 600 )
        !            34: 
        !            35: /*
        !            36:  * Definitions for old MS C6-386 compiler
        !            37:  */
        !            38: #define _CRTAPI1 _cdecl
        !            39: #define _CRTAPI2 _cdecl
        !            40: #define _M_IX86  300
        !            41: 
        !            42: #else
        !            43: 
        !            44: /*
        !            45:  * Other compilers (e.g., MIPS)
        !            46:  */
        !            47: #define _CRTAPI1
        !            48: #define _CRTAPI2
        !            49: 
1.1.1.2   root       50: #endif
1.1       root       51: 
1.1.1.3 ! root       52: 
1.1       root       53: #define DBL_DIG        15                      /* # of decimal digits of precision */
                     54: #define DBL_EPSILON    2.2204460492503131e-016 /* smallest such that 1.0+DBL_EPSILON != 1.0 */
                     55: #define DBL_MANT_DIG   53                      /* # of bits in mantissa */
                     56: #define DBL_MAX        1.7976931348623158e+308 /* max value */
                     57: #define DBL_MAX_10_EXP 308                     /* max decimal exponent */
                     58: #define DBL_MAX_EXP    1024                    /* max binary exponent */
                     59: #define DBL_MIN        2.2250738585072014e-308 /* min positive value */
                     60: #define DBL_MIN_10_EXP (-307)                  /* min decimal exponent */
                     61: #define DBL_MIN_EXP    (-1021)                 /* min binary exponent */
                     62: #define _DBL_RADIX     2                       /* exponent radix */
                     63: #define _DBL_ROUNDS    1                       /* addition rounding: near */
                     64: 
                     65: #define FLT_DIG        6                       /* # of decimal digits of precision */
                     66: #define FLT_EPSILON    1.192092896e-07F        /* smallest such that 1.0+FLT_EPSILON != 1.0 */
                     67: #define FLT_GUARD      0
                     68: #define FLT_MANT_DIG   24                      /* # of bits in mantissa */
                     69: #define FLT_MAX        3.402823466e+38F        /* max value */
                     70: #define FLT_MAX_10_EXP 38                      /* max decimal exponent */
                     71: #define FLT_MAX_EXP    128                     /* max binary exponent */
                     72: #define FLT_MIN        1.175494351e-38F        /* min positive value */
                     73: #define FLT_MIN_10_EXP (-37)                   /* min decimal exponent */
                     74: #define FLT_MIN_EXP    (-125)                  /* min binary exponent */
                     75: #define FLT_NORMALIZE  0
                     76: #define FLT_RADIX      2                       /* exponent radix */
                     77: #define FLT_ROUNDS     1                       /* addition rounding: near */
                     78: 
                     79: #define LDBL_DIG       DBL_DIG                 /* # of decimal digits of precision */
                     80: #define LDBL_EPSILON   DBL_EPSILON             /* smallest such that 1.0+LDBL_EPSILON != 1.0 */
                     81: #define LDBL_MANT_DIG  DBL_MANT_DIG            /* # of bits in mantissa */
                     82: #define LDBL_MAX       DBL_MAX                 /* max value */
                     83: #define LDBL_MAX_10_EXP DBL_MAX_10_EXP         /* max decimal exponent */
                     84: #define LDBL_MAX_EXP   DBL_MAX_EXP             /* max binary exponent */
                     85: #define LDBL_MIN       DBL_MIN                 /* min positive value */
                     86: #define LDBL_MIN_10_EXP DBL_MIN_10_EXP         /* min decimal exponent */
                     87: #define LDBL_MIN_EXP   DBL_MIN_EXP             /* min binary exponent */
                     88: #define _LDBL_RADIX    DBL_RADIX               /* exponent radix */
                     89: #define _LDBL_ROUNDS   DBL_ROUNDS              /* addition rounding: near */
                     90: 
                     91: 
                     92: 
1.1.1.2   root       93: 
                     94: /* function prototypes */
                     95: 
1.1.1.3 ! root       96: unsigned int _CRTAPI1 _clearfp(void);
        !            97: unsigned int _CRTAPI1 _controlfp(unsigned int,unsigned int);
        !            98: unsigned int _CRTAPI1 _statusfp(void);
        !            99: void _CRTAPI1 _fpreset(void);
1.1.1.2   root      100: 
                    101: #define _clear87       _clearfp
                    102: #define _status87      _statusfp
                    103: 
1.1       root      104: /*
1.1.1.2   root      105:  * Abstract User Control Word Mask and bit definitions
1.1       root      106:  */
                    107: 
1.1.1.2   root      108: #define _MCW_EM        0x0008001f              /* interrupt Exception Masks */
                    109: #define _EM_INEXACT    0x00000001              /*   inexact (precision) */
                    110: #define _EM_UNDERFLOW  0x00000002              /*   underflow */
                    111: #define _EM_OVERFLOW   0x00000004              /*   overflow */
                    112: #define _EM_ZERODIVIDE 0x00000008              /*   zero divide */
                    113: #define _EM_INVALID    0x00000010              /*   invalid */
                    114: 
                    115: #define _MCW_RC        0x00000300              /* Rounding Control */
                    116: #define _RC_NEAR       0x00000000              /*   near */
                    117: #define _RC_DOWN       0x00000100              /*   down */
                    118: #define _RC_UP         0x00000200              /*   up */
                    119: #define _RC_CHOP       0x00000300              /*   chop */
1.1       root      120: 
1.1.1.2   root      121: /*
                    122:  * Abstract User Status Word bit definitions
1.1       root      123:  */
                    124: 
1.1.1.2   root      125: #define _SW_INEXACT    0x00000001              /* inexact (precision) */
                    126: #define _SW_UNDERFLOW  0x00000002              /* underflow */
                    127: #define _SW_OVERFLOW   0x00000004              /* overflow */
                    128: #define _SW_ZERODIVIDE 0x00000008              /* zero divide */
                    129: #define _SW_INVALID    0x00000010              /* invalid */
1.1       root      130: 
                    131: 
1.1.1.2   root      132: /*
                    133:  * i386 specific definitions
                    134:  */
1.1       root      135: 
1.1.1.2   root      136: #define _MCW_PC        0x00030000              /* Precision Control */
                    137: #define _PC_64         0x00000000              /*    64 bits */
                    138: #define _PC_53         0x00010000              /*    53 bits */
                    139: #define _PC_24         0x00020000              /*    24 bits */
                    140: 
                    141: #define _MCW_IC        0x00040000              /* Infinity Control */
                    142: #define _IC_AFFINE     0x00040000              /*   affine */
                    143: #define _IC_PROJECTIVE 0x00000000              /*   projective */
1.1       root      144: 
1.1.1.2   root      145: #define _EM_DENORMAL   0x00080000              /* denormal exception mask (_control87 only) */
1.1       root      146: 
1.1.1.2   root      147: #define _SW_DENORMAL   0x00080000              /* denormal status bit */
1.1       root      148: 
                    149: 
1.1.1.3 ! root      150: unsigned int _CRTAPI1 _control87(unsigned int,unsigned int);
1.1       root      151: 
                    152: 
1.1.1.2   root      153: /*
                    154:  * MIPS R4000 specific definitions
                    155:  */
                    156: 
                    157: #define _MCW_DN        0x01000000              /* Denormal Control (R4000) */
                    158: #define _DN_FLUSH      0x01000000              /*   flush to zero */
                    159: #define _DN_SAVE       0x00000000              /*   save */
1.1       root      160: 
                    161: 
1.1.1.2   root      162: /* initial Control Word value */
                    163: 
1.1.1.3 ! root      164: #ifdef _M_IX86
1.1.1.2   root      165: 
                    166: #define _CW_DEFAULT ( _RC_NEAR + _PC_64 + _EM_INVALID + _EM_ZERODIVIDE + _EM_OVERFLOW + _EM_UNDERFLOW + _EM_INEXACT )
                    167: 
1.1.1.3 ! root      168: #elif  ( defined(_M_RX000) || defined(M_MRX000) || defined(MIPS) || defined(MIPS) )
1.1.1.2   root      169: 
                    170: #define _CW_DEFAULT ( _RC_NEAR + _DN_FLUSH + _EM_INVALID + _EM_ZERODIVIDE + _EM_OVERFLOW + _EM_UNDERFLOW + _EM_INEXACT )
                    171: 
                    172: #endif
                    173: 
1.1       root      174: /* Global variable holding floating point error code */
                    175: 
                    176: #ifdef _MT
1.1.1.3 ! root      177: extern int * _CRTAPI1 __fpecode(void);
1.1       root      178: #define _fpecode       (*__fpecode())
                    179: #else
                    180: extern int _fpecode;
                    181: #endif
                    182: 
1.1.1.2   root      183: /* invalid subconditions (_SW_INVALID also set) */
                    184: 
                    185: #define _SW_UNEMULATED         0x0040  /* unemulated instruction */
                    186: #define _SW_SQRTNEG            0x0080  /* square root of a neg number */
                    187: #define _SW_STACKOVERFLOW      0x0200  /* FP stack overflow */
                    188: #define _SW_STACKUNDERFLOW     0x0400  /* FP stack underflow */
1.1       root      189: 
                    190: /*  Floating point error signals and return codes */
                    191: 
                    192: #define _FPE_INVALID           0x81
                    193: #define _FPE_DENORMAL          0x82
                    194: #define _FPE_ZERODIVIDE        0x83
                    195: #define _FPE_OVERFLOW          0x84
                    196: #define _FPE_UNDERFLOW         0x85
                    197: #define _FPE_INEXACT           0x86
                    198: 
                    199: #define _FPE_UNEMULATED        0x87
                    200: #define _FPE_SQRTNEG           0x88
                    201: #define _FPE_STACKOVERFLOW     0x8a
                    202: #define _FPE_STACKUNDERFLOW    0x8b
                    203: 
                    204: #define _FPE_EXPLICITGEN       0x8c    /* raise( SIGFPE ); */
                    205: 
                    206: 
1.1.1.2   root      207: /* IEEE recommended functions */
                    208: 
1.1.1.3 ! root      209: double _CRTAPI1 _copysign (double, double);
        !           210: double _CRTAPI1 _chgsign (double);
        !           211: double _CRTAPI1 _scalb(double, long);
        !           212: double _CRTAPI1 _logb(double);
        !           213: double _CRTAPI1 _nextafter(double, double);
        !           214: int    _CRTAPI1 _finite(double);
        !           215: int    _CRTAPI1 _isnan(double);
        !           216: int    _CRTAPI1 _fpclass(double);
1.1.1.2   root      217: 
                    218: #define _FPCLASS_SNAN  0x0001  /* signaling NaN */
                    219: #define _FPCLASS_QNAN  0x0002  /* quiet NaN */
                    220: #define _FPCLASS_NINF  0x0004  /* negative infinity */
                    221: #define _FPCLASS_NN    0x0008  /* negative normal */
                    222: #define _FPCLASS_ND    0x0010  /* negative denormal */
                    223: #define _FPCLASS_NZ    0x0020  /* -0 */
                    224: #define _FPCLASS_PZ    0x0040  /* +0 */
                    225: #define _FPCLASS_PD    0x0080  /* positive denormal */
                    226: #define _FPCLASS_PN    0x0100  /* positive normal */
                    227: #define _FPCLASS_PINF  0x0200  /* positive infinity */
1.1       root      228: 
                    229: 
                    230: #if !__STDC__
                    231: /* Non-ANSI names for compatibility */
                    232: 
1.1.1.2   root      233: #define clear87                        _clear87
                    234: #define status87               _status87
                    235: #define control87              _control87
                    236: #define fpreset                        _fpreset
                    237: 
1.1       root      238: #define DBL_RADIX              _DBL_RADIX
                    239: #define DBL_ROUNDS             _DBL_ROUNDS
                    240: 
                    241: #define LDBL_RADIX             _LDBL_RADIX
                    242: #define LDBL_ROUNDS            _LDBL_ROUNDS
                    243: 
                    244: #define MCW_EM                 _MCW_EM
                    245: #define EM_INVALID             _EM_INVALID
                    246: #define EM_DENORMAL            _EM_DENORMAL
                    247: #define EM_ZERODIVIDE          _EM_ZERODIVIDE
                    248: #define EM_OVERFLOW            _EM_OVERFLOW
                    249: #define EM_UNDERFLOW           _EM_UNDERFLOW
                    250: #define EM_INEXACT             _EM_INEXACT
                    251: 
                    252: #define MCW_IC                 _MCW_IC
                    253: #define IC_AFFINE              _IC_AFFINE
                    254: #define IC_PROJECTIVE          _IC_PROJECTIVE
                    255: 
                    256: #define MCW_RC                 _MCW_RC
                    257: #define RC_CHOP                _RC_CHOP
                    258: #define RC_UP                  _RC_UP
                    259: #define RC_DOWN                _RC_DOWN
                    260: #define RC_NEAR                _RC_NEAR
                    261: 
                    262: #define MCW_PC                 _MCW_PC
                    263: #define PC_24                  _PC_24
                    264: #define PC_53                  _PC_53
                    265: #define PC_64                  _PC_64
                    266: 
                    267: #define CW_DEFAULT             _CW_DEFAULT
                    268: 
                    269: #define SW_INVALID             _SW_INVALID
                    270: #define SW_DENORMAL            _SW_DENORMAL
                    271: #define SW_ZERODIVIDE          _SW_ZERODIVIDE
                    272: #define SW_OVERFLOW            _SW_OVERFLOW
                    273: #define SW_UNDERFLOW           _SW_UNDERFLOW
                    274: #define SW_INEXACT             _SW_INEXACT
                    275: 
                    276: #define SW_UNEMULATED          _SW_UNEMULATED
                    277: #define SW_SQRTNEG             _SW_SQRTNEG
                    278: #define SW_STACKOVERFLOW       _SW_STACKOVERFLOW
                    279: #define SW_STACKUNDERFLOW      _SW_STACKUNDERFLOW
                    280: 
                    281: #define FPE_INVALID            _FPE_INVALID
                    282: #define FPE_DENORMAL           _FPE_DENORMAL
                    283: #define FPE_ZERODIVIDE         _FPE_ZERODIVIDE
                    284: #define FPE_OVERFLOW           _FPE_OVERFLOW
                    285: #define FPE_UNDERFLOW          _FPE_UNDERFLOW
                    286: #define FPE_INEXACT            _FPE_INEXACT
                    287: 
                    288: #define FPE_UNEMULATED         _FPE_UNEMULATED
                    289: #define FPE_SQRTNEG            _FPE_SQRTNEG
                    290: #define FPE_STACKOVERFLOW      _FPE_STACKOVERFLOW
                    291: #define FPE_STACKUNDERFLOW     _FPE_STACKUNDERFLOW
                    292: 
                    293: #define FPE_EXPLICITGEN        _FPE_EXPLICITGEN
                    294: 
                    295: 
1.1.1.2   root      296: #endif /* __STDC__ */
1.1       root      297: 
                    298: #ifdef __cplusplus
                    299: }
                    300: #endif
                    301: 
                    302: #define _INC_FLOAT
                    303: #endif /* _INC_FLOAT */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.