|
|
1.1 root 1: /***
2: *math.h - definitions and declarations for math library
3: *
4: * Copyright (c) 1985-1987, Microsoft Corporation. All rights reserved.
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:
14: #ifndef NO_EXT_KEYS /* extensions enabled */
15: #define _CDECL cdecl
16: #else /* extensions not enabled */
17: #define _CDECL
18: #endif /* NO_EXT_KEYS */
19:
20:
21: /* definition of exception struct - this struct is passed to the matherr
22: * routine when a floating point exception is detected
23: */
24:
25: #ifndef _EXCEPTION_DEFINED
26: struct exception {
27: int type; /* exception type - see below */
28: char *name; /* name of function where error occured */
29: double arg1; /* first argument to function */
30: double arg2; /* second argument (if any) to function */
31: double retval; /* value to be returned by function */
32: } ;
33: #define _EXCEPTION_DEFINED
34: #endif
35:
36:
37: /* definition of a complex struct to be used by those who use cabs and
38: * want type checking on their argument
39: */
40:
41: #ifndef _COMPLEX_DEFINED
42: struct complex {
43: double x,y; /* real and imaginary parts */
44: } ;
45: #define _COMPLEX_DEFINED
46: #endif
47:
48:
49: /* Constant definitions for the exception type passed in the exception struct
50: */
51:
52: #define DOMAIN 1 /* argument domain error */
53: #define SING 2 /* argument singularity */
54: #define OVERFLOW 3 /* overflow range error */
55: #define UNDERFLOW 4 /* underflow range error */
56: #define TLOSS 5 /* total loss of precision */
57: #define PLOSS 6 /* partial loss of precision */
58:
59: #define EDOM 33
60: #define ERANGE 34
61:
62:
63: /* definitions of HUGE and HUGE_VAL - respectively the XENIX and ANSI names
64: * for a value returned in case of error by a number of the floating point
65: * math routines
66: */
67:
68: extern double HUGE;
69: #define HUGE_VAL HUGE
70:
71:
72: /* function prototypes */
73:
74: int _CDECL abs(int);
75: double _CDECL acos(double);
76: double _CDECL asin(double);
77: double _CDECL atan(double);
78: double _CDECL atan2(double, double);
79: double _CDECL atof(const char *);
80: double _CDECL cabs(struct complex);
81: double _CDECL ceil(double);
82: double _CDECL cos(double);
83: double _CDECL cosh(double);
84: int _CDECL dieeetomsbin(double *, double *);
85: int _CDECL dmsbintoieee(double *, double *);
86: double _CDECL exp(double);
87: double _CDECL fabs(double);
88: int _CDECL fieeetomsbin(float *, float *);
89: double _CDECL floor(double);
90: double _CDECL fmod(double, double);
91: int _CDECL fmsbintoieee(float *, float *);
92: double _CDECL frexp(double, int *);
93: double _CDECL hypot(double, double);
94: double _CDECL j0(double);
95: double _CDECL j1(double);
96: double _CDECL jn(int, double);
97: long _CDECL labs(long);
98: double _CDECL ldexp(double, int);
99: double _CDECL log(double);
100: double _CDECL log10(double);
101: int _CDECL matherr(struct exception *);
102: double _CDECL modf(double, double *);
103: double _CDECL pow(double, double);
104: double _CDECL sin(double);
105: double _CDECL sinh(double);
106: double _CDECL sqrt(double);
107: double _CDECL tan(double);
108: double _CDECL tanh(double);
109: double _CDECL y0(double);
110: double _CDECL y1(double);
111: double _CDECL yn(int, double);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.