syscons util remove use kbdcontrol & vidcontrol instead
[unix-history] / lib / msun / math.h
CommitLineData
4acf9396
GCI
1/*
2 * ====================================================
3 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
4 *
5 * Developed at SunPro, a Sun Microsystems, Inc. business.
6 * Permission to use, copy, modify, and distribute this
7 * software is freely granted, provided that this notice
8 * is preserved.
9 * ====================================================
10 */
11
12/*
13 * from: @(#)fdlibm.h 5.1 93/09/24
14 * $Id: math.h,v 1.8 1994/03/01 17:16:19 jtc Exp $
15 */
16
17#ifndef _MATH_H_
18#define _MATH_H_
19
20/*
21 * ANSI/POSIX
22 */
23extern char __infinity[];
24#define HUGE_VAL (*(double *) __infinity)
25
26/*
27 * XOPEN/SVID
28 */
29#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
30#define M_E 2.7182818284590452354 /* e */
31#define M_LOG2E 1.4426950408889634074 /* log 2e */
32#define M_LOG10E 0.43429448190325182765 /* log 10e */
33#define M_LN2 0.69314718055994530942 /* log e2 */
34#define M_LN10 2.30258509299404568402 /* log e10 */
35#define M_PI 3.14159265358979323846 /* pi */
36#define M_PI_2 1.57079632679489661923 /* pi/2 */
37#define M_PI_4 0.78539816339744830962 /* pi/4 */
38#define M_1_PI 0.31830988618379067154 /* 1/pi */
39#define M_2_PI 0.63661977236758134308 /* 2/pi */
40#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
41#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
42#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
43
44#define MAXFLOAT ((float)3.40282346638528860e+38)
45extern int signgam;
46
47#if !defined(_XOPEN_SOURCE)
48enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix};
49
50#define _LIB_VERSION_TYPE enum fdversion
51#define _LIB_VERSION _fdlib_version
52
53/* if global variable _LIB_VERSION is not desirable, one may
54 * change the following to be a constant by:
55 * #define _LIB_VERSION_TYPE const enum version
56 * In that case, after one initializes the value _LIB_VERSION (see
57 * s_lib_version.c) during compile time, it cannot be modified
58 * in the middle of a program
59 */
60extern _LIB_VERSION_TYPE _LIB_VERSION;
61
62#define _IEEE_ fdlibm_ieee
63#define _SVID_ fdlibm_svid
64#define _XOPEN_ fdlibm_xopen
65#define _POSIX_ fdlibm_posix
66
67struct exception {
68 int type;
69 char *name;
70 double arg1;
71 double arg2;
72 double retval;
73};
74
75#define HUGE MAXFLOAT
76
77/*
78 * set X_TLOSS = pi*2**52, which is possibly defined in <values.h>
79 * (one may replace the following line by "#include <values.h>")
80 */
81
82#define X_TLOSS 1.41484755040568800000e+16
83
84#define DOMAIN 1
85#define SING 2
86#define OVERFLOW 3
87#define UNDERFLOW 4
88#define TLOSS 5
89#define PLOSS 6
90
91#endif /* !_XOPEN_SOURCE */
92#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
93
94
95#include <sys/cdefs.h>
96__BEGIN_DECLS
97/*
98 * ANSI/POSIX
99 */
100extern double acos __P((double));
101extern double asin __P((double));
102extern double atan __P((double));
103extern double atan2 __P((double, double));
104extern double cos __P((double));
105extern double sin __P((double));
106extern double tan __P((double));
107
108extern double cosh __P((double));
109extern double sinh __P((double));
110extern double tanh __P((double));
111
112extern double exp __P((double));
113extern double frexp __P((double, int *));
114extern double ldexp __P((double, int));
115extern double log __P((double));
116extern double log10 __P((double));
117extern double modf __P((double, double *));
118
119extern double pow __P((double, double));
120extern double sqrt __P((double));
121
122extern double ceil __P((double));
123extern double fabs __P((double));
124extern double floor __P((double));
125extern double fmod __P((double, double));
126
127#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
128extern double erf __P((double));
129extern double erfc __P((double));
130extern double gamma __P((double));
131extern double hypot __P((double, double));
132extern int isinf __P((double));
133extern int isnan __P((double));
134extern int finite __P((double));
135extern double j0 __P((double));
136extern double j1 __P((double));
137extern double jn __P((int, double));
138extern double lgamma __P((double));
139extern double y0 __P((double));
140extern double y1 __P((double));
141extern double yn __P((int, double));
142
143#if !defined(_XOPEN_SOURCE)
144extern double acosh __P((double));
145extern double asinh __P((double));
146extern double atanh __P((double));
147extern double cbrt __P((double));
148extern double logb __P((double));
149extern double nextafter __P((double, double));
150extern double remainder __P((double, double));
151extern double scalb __P((double, double));
152
153extern int matherr __P((struct exception *));
154
155/*
156 * IEEE Test Vector
157 */
158extern double significand __P((double));
159
160/*
161 * Functions callable from C, intended to support IEEE arithmetic.
162 */
163extern double copysign __P((double, double));
164extern int ilogb __P((double));
165extern double rint __P((double));
166extern double scalbn __P((double, int));
167
168/*
169 * BSD math library entry points
170 */
171extern double cabs();
172extern double drem __P((double, double));
173extern double expm1 __P((double));
174extern double log1p __P((double));
175
176/*
177 * Reentrant version of gamma & lgamma; passes signgam back by reference
178 * as the second argument; user must allocate space for signgam.
179 */
180#ifdef _REENTRANT
181extern double gamma_r __P((double, int *));
182extern double lgamma_r __P((double, int *));
183#endif /* _REENTRANT */
184#endif /* !_XOPEN_SOURCE */
185#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
186
187/* ieee style elementary functions */
188extern double __ieee754_sqrt __P((double));
189extern double __ieee754_acos __P((double));
190extern double __ieee754_acosh __P((double));
191extern double __ieee754_log __P((double));
192extern double __ieee754_atanh __P((double));
193extern double __ieee754_asin __P((double));
194extern double __ieee754_atan2 __P((double,double));
195extern double __ieee754_exp __P((double));
196extern double __ieee754_cosh __P((double));
197extern double __ieee754_fmod __P((double,double));
198extern double __ieee754_pow __P((double,double));
199extern double __ieee754_lgamma_r __P((double,int *));
200extern double __ieee754_gamma_r __P((double,int *));
201extern double __ieee754_lgamma __P((double));
202extern double __ieee754_gamma __P((double));
203extern double __ieee754_log10 __P((double));
204extern double __ieee754_sinh __P((double));
205extern double __ieee754_hypot __P((double,double));
206extern double __ieee754_j0 __P((double));
207extern double __ieee754_j1 __P((double));
208extern double __ieee754_y0 __P((double));
209extern double __ieee754_y1 __P((double));
210extern double __ieee754_jn __P((int,double));
211extern double __ieee754_yn __P((int,double));
212extern double __ieee754_remainder __P((double,double));
213extern int __ieee754_rem_pio2 __P((double,double*));
214extern double __ieee754_scalb __P((double,double));
215
216/* fdlibm kernel function */
217extern double __kernel_standard __P((double,double,int));
218extern double __kernel_sin __P((double,double,int));
219extern double __kernel_cos __P((double,double));
220extern double __kernel_tan __P((double,double,int));
221extern int __kernel_rem_pio2 __P((double*,double*,int,int,int,const int*));
222__END_DECLS
223
224#endif /* _MATH_H_ */