Annotation of mstools/h/math.h, revision 1.1.1.4

1.1       root        1: /***
                      2: *math.h - definitions and declarations for math library
                      3: *
1.1.1.4 ! root        4: *      Copyright (c) 1985-1993, Microsoft Corporation. All rights reserved.
1.1       root        5: *
                      6: *Purpose:
                      7: *      This file contains constant definitions and external subroutine
                      8: *      declarations for the math subroutine library.
                      9: *      [ANSI/System V]
                     10: *
                     11: ****/
                     12: 
                     13: #ifndef _INC_MATH
                     14: 
                     15: #ifdef __cplusplus
                     16: extern "C" {
                     17: #endif
                     18: 
                     19: 
1.1.1.3   root       20: /*
                     21:  * Conditional macro definition for function calling type and variable type
                     22:  * qualifiers.
                     23:  */
                     24: #if   ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
                     25: 
                     26: /*
                     27:  * Definitions for MS C8-32 (386/486) compiler
                     28:  */
                     29: #define _CRTAPI1 __cdecl
                     30: #define _CRTAPI2 __cdecl
                     31: 
                     32: #else
                     33: 
                     34: /*
                     35:  * Other compilers (e.g., MIPS)
                     36:  */
                     37: #define _CRTAPI1
                     38: #define _CRTAPI2
                     39: 
1.1.1.2   root       40: #endif
1.1       root       41: 
1.1.1.3   root       42: 
1.1       root       43: /* definition of _exception struct - this struct is passed to the matherr
                     44:  * routine when a floating point exception is detected
                     45:  */
                     46: 
                     47: #ifndef _EXCEPTION_DEFINED
                     48: struct _exception {
                     49:        int type;               /* exception type - see below */
                     50:        char *name;             /* name of function where error occured */
                     51:        double arg1;            /* first argument to function */
                     52:        double arg2;            /* second argument (if any) to function */
                     53:        double retval;          /* value to be returned by function */
                     54:        } ;
                     55: 
                     56: #if !__STDC__
                     57: /* Non-ANSI name for compatibility */
                     58: #define exception _exception
                     59: #endif
                     60: 
                     61: #define _EXCEPTION_DEFINED
                     62: #endif
                     63: 
                     64: 
                     65: /* definition of a _complex struct to be used by those who use cabs and
                     66:  * want type checking on their argument
                     67:  */
                     68: 
                     69: #ifndef _COMPLEX_DEFINED
                     70: struct _complex {
                     71:        double x,y;     /* real and imaginary parts */
                     72:        } ;
                     73: 
                     74: #if !__STDC__
                     75: /* Non-ANSI name for compatibility */
                     76: #define complex _complex
                     77: #endif
                     78: 
                     79: #define _COMPLEX_DEFINED
                     80: #endif
                     81: 
                     82: 
                     83: /* Constant definitions for the exception type passed in the _exception struct
                     84:  */
                     85: 
                     86: #define _DOMAIN        1       /* argument domain error */
                     87: #define _SING          2       /* argument singularity */
                     88: #define _OVERFLOW      3       /* overflow range error */
                     89: #define _UNDERFLOW     4       /* underflow range error */
                     90: #define _TLOSS         5       /* total loss of precision */
                     91: #define _PLOSS         6       /* partial loss of precision */
                     92: 
                     93: #define EDOM           33
                     94: #define ERANGE         34
                     95: 
                     96: 
                     97: /* definitions of _HUGE and HUGE_VAL - respectively the XENIX and ANSI names
                     98:  * for a value returned in case of error by a number of the floating point
                     99:  * math routines
                    100:  */
1.1.1.2   root      101: #ifdef _DLL
                    102: #define _HUGE  (*_HUGE_dll)
                    103: extern double * _HUGE_dll;
                    104: #else
1.1       root      105: extern double _HUGE;
1.1.1.2   root      106: #endif
                    107: 
1.1       root      108: #define HUGE_VAL _HUGE
                    109: 
                    110: /* function prototypes */
                    111: 
1.1.1.3   root      112: int    _CRTAPI1 abs(int);
                    113: double _CRTAPI1 acos(double);
                    114: double _CRTAPI1 asin(double);
                    115: double _CRTAPI1 atan(double);
                    116: double _CRTAPI1 atan2(double, double);
                    117: double _CRTAPI1 atof(const char *);
                    118: double _CRTAPI1 _cabs(struct _complex);
                    119: double _CRTAPI1 ceil(double);
                    120: double _CRTAPI1 cos(double);
                    121: double _CRTAPI1 cosh(double);
                    122: double _CRTAPI1 exp(double);
                    123: double _CRTAPI1 fabs(double);
                    124: double _CRTAPI1 floor(double);
                    125: double _CRTAPI1 fmod(double, double);
                    126: double _CRTAPI1 frexp(double, int *);
                    127: double _CRTAPI1 _hypot(double, double);
                    128: double _CRTAPI1 _j0(double);
                    129: double _CRTAPI1 _j1(double);
                    130: double _CRTAPI1 _jn(int, double);
                    131: long   _CRTAPI1 labs(long);
                    132: double _CRTAPI1 ldexp(double, int);
                    133: double _CRTAPI1 log(double);
                    134: double _CRTAPI1 log10(double);
                    135: int    _CRTAPI1 _matherr(struct _exception *);
                    136: double _CRTAPI1 modf(double, double *);
                    137: double _CRTAPI1 pow(double, double);
                    138: double _CRTAPI1 sin(double);
                    139: double _CRTAPI1 sinh(double);
                    140: double _CRTAPI1 sqrt(double);
                    141: double _CRTAPI1 tan(double);
                    142: double _CRTAPI1 tanh(double);
                    143: double _CRTAPI1 _y0(double);
                    144: double _CRTAPI1 _y1(double);
                    145: double _CRTAPI1 _yn(int, double);
1.1       root      146: 
                    147: #if !__STDC__
                    148: /* Non-ANSI names for compatibility */
                    149: 
                    150: #define DOMAIN         _DOMAIN
                    151: #define SING           _SING
                    152: #define OVERFLOW       _OVERFLOW
                    153: #define UNDERFLOW      _UNDERFLOW
                    154: #define TLOSS          _TLOSS
                    155: #define PLOSS          _PLOSS
                    156: 
                    157: #define matherr        _matherr
                    158: 
1.1.1.2   root      159: #ifdef _DLL
                    160: #define HUGE   (*HUGE_dll)
                    161: extern double * HUGE_dll;
                    162: #else
1.1       root      163: extern double HUGE;
1.1.1.2   root      164: #endif
1.1       root      165: 
                    166: #define cabs           _cabs
                    167: #define hypot          _hypot
                    168: #define j0             _j0
                    169: #define j1             _j1
                    170: #define jn             _jn
                    171: #define matherr        _matherr
                    172: #define y0             _y0
                    173: #define y1             _y1
                    174: #define yn             _yn
                    175: 
                    176: #define cabsl          _cabsl
                    177: #define hypotl         _hypotl
                    178: #endif /* __STDC__ */
                    179: 
                    180: #ifdef __cplusplus
                    181: }
                    182: #endif
                    183: 
                    184: #define _INC_MATH
                    185: #endif /* _INC_MATH */

unix.superglobalmegacorp.com

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