The following bugs have been fixed:
[tangerine.git] / compiler / mlib / fdlibm.h
blob8059bd02f8a8152e8eb72785d54a2b7479386556
2 /* @(#)fdlibm.h 1.5 95/01/18 */
3 /*
4 * ====================================================
5 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
7 * Developed at SunSoft, a Sun Microsystems, Inc. business.
8 * Permission to use, copy, modify, and distribute this
9 * software is freely granted, provided that this notice
10 * is preserved.
11 * ====================================================
14 #ifndef AROS_CPU_H
15 #include <aros/cpu.h>
16 #endif
17 #if AROS_BIG_ENDIAN == 0
18 #define __LITTLE_ENDIAN
19 #endif
21 #ifdef __NEWVALID /* special setup for Sun test regime */
22 #if defined(i386) || defined(i486) || \
23 defined(intel) || defined(x86) || defined(i86pc)
24 #define __LITTLE_ENDIAN
25 #endif
26 #endif
28 #ifdef __LITTLE_ENDIAN
29 #define __HI(x) *(1+(int*)&x)
30 #define __LO(x) *(int*)&x
31 #define __HIp(x) *(1+(int*)x)
32 #define __LOp(x) *(int*)x
33 #else
34 #define __HI(x) *(int*)&x
35 #define __LO(x) *(1+(int*)&x)
36 #define __HIp(x) *(int*)x
37 #define __LOp(x) *(1+(int*)x)
38 #endif
40 #ifdef __STDC__
41 #define __P(p) p
42 #else
43 #define __P(p) ()
44 #endif
47 * ANSI/POSIX
50 extern int signgam;
52 #define MAXFLOAT ((float)3.40282346638528860e+38)
54 enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix};
56 #define _LIB_VERSION_TYPE enum fdversion
57 #define _LIB_VERSION _fdlib_version
59 /* if global variable _LIB_VERSION is not desirable, one may
60 * change the following to be a constant by:
61 * #define _LIB_VERSION_TYPE const enum version
62 * In that case, after one initializes the value _LIB_VERSION (see
63 * s_lib_version.c) during compile time, it cannot be modified
64 * in the middle of a program
65 */
66 extern _LIB_VERSION_TYPE _LIB_VERSION;
68 #define _IEEE_ fdlibm_ieee
69 #define _SVID_ fdlibm_svid
70 #define _XOPEN_ fdlibm_xopen
71 #define _POSIX_ fdlibm_posix
73 struct exception {
74 int type;
75 char *name;
76 double arg1;
77 double arg2;
78 double retval;
81 #define HUGE MAXFLOAT
83 /*
84 * set X_TLOSS = pi*2**52, which is possibly defined in <values.h>
85 * (one may replace the following line by "#include <values.h>")
88 #define X_TLOSS 1.41484755040568800000e+16
90 #define DOMAIN 1
91 #define SING 2
92 #define OVERFLOW 3
93 #define UNDERFLOW 4
94 #define TLOSS 5
95 #define PLOSS 6
98 * ANSI/POSIX
100 extern double acos __P((double));
101 extern double asin __P((double));
102 extern double atan __P((double));
103 extern double atan2 __P((double, double));
104 extern double cos __P((double));
105 extern double sin __P((double));
106 extern double tan __P((double));
108 extern double cosh __P((double));
109 extern double sinh __P((double));
110 extern double tanh __P((double));
112 extern double exp __P((double));
113 extern double frexp __P((double, int *));
114 extern double ldexp __P((double, int));
115 extern double log __P((double));
116 extern double log10 __P((double));
117 extern double modf __P((double, double *));
119 extern double pow __P((double, double));
120 extern double sqrt __P((double));
122 extern double ceil __P((double));
123 extern double fabs __P((double));
124 extern double floor __P((double));
125 extern double fmod __P((double, double));
127 extern double erf __P((double));
128 extern double erfc __P((double));
129 extern double gamma __P((double));
130 extern double hypot __P((double, double));
131 extern int isnan __P((double));
132 extern int finite __P((double));
133 extern double j0 __P((double));
134 extern double j1 __P((double));
135 extern double jn __P((int, double));
136 extern double lgamma __P((double));
137 extern double y0 __P((double));
138 extern double y1 __P((double));
139 extern double yn __P((int, double));
141 extern double acosh __P((double));
142 extern double asinh __P((double));
143 extern double atanh __P((double));
144 extern double cbrt __P((double));
145 extern double logb __P((double));
146 extern double nextafter __P((double, double));
147 extern double remainder __P((double, double));
148 #ifdef _SCALB_INT
149 extern double scalb __P((double, int));
150 #else
151 extern double scalb __P((double, double));
152 #endif
154 extern int matherr __P((struct exception *));
157 * IEEE Test Vector
159 extern double significand __P((double));
162 * Functions callable from C, intended to support IEEE arithmetic.
164 extern double copysign __P((double, double));
165 extern int ilogb __P((double));
166 extern double rint __P((double));
167 extern double scalbn __P((double, int));
170 * BSD math library entry points
172 extern double expm1 __P((double));
173 extern double log1p __P((double));
176 * Reentrant version of gamma & lgamma; passes signgam back by reference
177 * as the second argument; user must allocate space for signgam.
179 #ifdef _REENTRANT
180 extern double gamma_r __P((double, int *));
181 extern double lgamma_r __P((double, int *));
182 #endif /* _REENTRANT */
184 /* ieee style elementary functions */
185 extern double __ieee754_sqrt __P((double));
186 extern double __ieee754_acos __P((double));
187 extern double __ieee754_acosh __P((double));
188 extern double __ieee754_log __P((double));
189 extern double __ieee754_atanh __P((double));
190 extern double __ieee754_asin __P((double));
191 extern double __ieee754_atan2 __P((double,double));
192 extern double __ieee754_exp __P((double));
193 extern double __ieee754_cosh __P((double));
194 extern double __ieee754_fmod __P((double,double));
195 extern double __ieee754_pow __P((double,double));
196 extern double __ieee754_lgamma_r __P((double,int *));
197 extern double __ieee754_gamma_r __P((double,int *));
198 extern double __ieee754_lgamma __P((double));
199 extern double __ieee754_gamma __P((double));
200 extern double __ieee754_log10 __P((double));
201 extern double __ieee754_sinh __P((double));
202 extern double __ieee754_hypot __P((double,double));
203 extern double __ieee754_j0 __P((double));
204 extern double __ieee754_j1 __P((double));
205 extern double __ieee754_y0 __P((double));
206 extern double __ieee754_y1 __P((double));
207 extern double __ieee754_jn __P((int,double));
208 extern double __ieee754_yn __P((int,double));
209 extern double __ieee754_remainder __P((double,double));
210 extern int __ieee754_rem_pio2 __P((double,double*));
211 #ifdef _SCALB_INT
212 extern double __ieee754_scalb __P((double,int));
213 #else
214 extern double __ieee754_scalb __P((double,double));
215 #endif
217 /* fdlibm kernel function */
218 extern double __kernel_standard __P((double,double,int));
219 extern double __kernel_sin __P((double,double,int));
220 extern double __kernel_cos __P((double,double));
221 extern double __kernel_tan __P((double,double,int));
222 extern int __kernel_rem_pio2 __P((double*,double*,int,int,int,const int*));