|
|
1.1 root 1: /***
2: *math.h - definitions and declarations for math library
3: *
1.1.1.2 ! root 4: * Copyright (c) 1985-1992, 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.2 ! root 20: #ifndef MIPS
1.1 root 21: #if (_MSC_VER <= 600)
22: #define __cdecl _cdecl
23: #endif
1.1.1.2 ! root 24: #endif
1.1 root 25:
26: /* definition of _exception struct - this struct is passed to the matherr
27: * routine when a floating point exception is detected
28: */
29:
30: #ifndef _EXCEPTION_DEFINED
31: struct _exception {
32: int type; /* exception type - see below */
33: char *name; /* name of function where error occured */
34: double arg1; /* first argument to function */
35: double arg2; /* second argument (if any) to function */
36: double retval; /* value to be returned by function */
37: } ;
38:
39: #if !__STDC__
40: /* Non-ANSI name for compatibility */
41: #define exception _exception
42: #endif
43:
44: #define _EXCEPTION_DEFINED
45: #endif
46:
47:
48: /* definition of a _complex struct to be used by those who use cabs and
49: * want type checking on their argument
50: */
51:
52: #ifndef _COMPLEX_DEFINED
53: struct _complex {
54: double x,y; /* real and imaginary parts */
55: } ;
56:
57: #if !__STDC__
58: /* Non-ANSI name for compatibility */
59: #define complex _complex
60: #endif
61:
62: #define _COMPLEX_DEFINED
63: #endif
64:
65:
66: /* Constant definitions for the exception type passed in the _exception struct
67: */
68:
69: #define _DOMAIN 1 /* argument domain error */
70: #define _SING 2 /* argument singularity */
71: #define _OVERFLOW 3 /* overflow range error */
72: #define _UNDERFLOW 4 /* underflow range error */
73: #define _TLOSS 5 /* total loss of precision */
74: #define _PLOSS 6 /* partial loss of precision */
75:
76: #define EDOM 33
77: #define ERANGE 34
78:
79:
80: /* definitions of _HUGE and HUGE_VAL - respectively the XENIX and ANSI names
81: * for a value returned in case of error by a number of the floating point
82: * math routines
83: */
1.1.1.2 ! root 84: #ifdef _DLL
! 85: #define _HUGE (*_HUGE_dll)
! 86: extern double * _HUGE_dll;
! 87: #else
1.1 root 88: extern double _HUGE;
1.1.1.2 ! root 89: #endif
! 90:
1.1 root 91: #define HUGE_VAL _HUGE
92:
93: /* function prototypes */
94:
95: int abs(int);
96: double acos(double);
97: double asin(double);
98: double atan(double);
99: double atan2(double, double);
100: double atof(const char *);
101: double _cabs(struct _complex);
102: double ceil(double);
103: double cos(double);
104: double cosh(double);
105: double exp(double);
106: double fabs(double);
107: double floor(double);
108: double fmod(double, double);
109: double frexp(double, int *);
110: double _hypot(double, double);
111: double _j0(double);
112: double _j1(double);
113: double _jn(int, double);
114: long labs(long);
115: double ldexp(double, int);
116: double log(double);
117: double log10(double);
118: int _matherr(struct _exception *);
119: double modf(double, double *);
120: double pow(double, double);
121: double sin(double);
122: double sinh(double);
123: double sqrt(double);
124: double tan(double);
125: double tanh(double);
126: double _y0(double);
127: double _y1(double);
128: double _yn(int, double);
129:
130:
131: #ifdef i386
132: #pragma function(acos, asin, atan, atan2, cos, cosh, exp, fmod, log, log10, pow, sin, sinh, sqrt, tan, tanh)
133: #endif
134:
135: #if !__STDC__
136: /* Non-ANSI names for compatibility */
137:
138: #define DOMAIN _DOMAIN
139: #define SING _SING
140: #define OVERFLOW _OVERFLOW
141: #define UNDERFLOW _UNDERFLOW
142: #define TLOSS _TLOSS
143: #define PLOSS _PLOSS
144:
145: #define matherr _matherr
146:
1.1.1.2 ! root 147: #ifdef _DLL
! 148: #define HUGE (*HUGE_dll)
! 149: extern double * HUGE_dll;
! 150: #else
1.1 root 151: extern double HUGE;
1.1.1.2 ! root 152: #endif
1.1 root 153:
154: #define cabs _cabs
155: #define hypot _hypot
156: #define j0 _j0
157: #define j1 _j1
158: #define jn _jn
159: #define matherr _matherr
160: #define y0 _y0
161: #define y1 _y1
162: #define yn _yn
163:
164: #define cabsl _cabsl
165: #define hypotl _hypotl
166: #endif /* __STDC__ */
167:
168: #ifdef __cplusplus
169: }
170: #endif
171:
172: #define _INC_MATH
173: #endif /* _INC_MATH */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.