1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
3
* ***** BEGIN LICENSE BLOCK *****
4
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
6
* The contents of this file are subject to the Mozilla Public License Version
7
* 1.1 (the "License"); you may not use this file except in compliance with
8
* the License. You may obtain a copy of the License at
9
* http://www.mozilla.org/MPL/
11
* Software distributed under the License is distributed on an "AS IS" basis,
12
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13
* for the specific language governing rights and limitations under the
16
* The Original Code is Mozilla Communicator client code, released
19
* The Initial Developer of the Original Code is
20
* Sun Microsystems, Inc.
21
* Portions created by the Initial Developer are Copyright (C) 1998
22
* the Initial Developer. All Rights Reserved.
26
* Alternatively, the contents of this file may be used under the terms of
27
* either of the GNU General Public License Version 2 or later (the "GPL"),
28
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29
* in which case the provisions of the GPL or the LGPL are applicable instead
30
* of those above. If you wish to allow use of your version of this file only
31
* under the terms of either the GPL or the LGPL, and not to allow others to
32
* use your version of this file under the terms of the MPL, indicate your
33
* decision by deleting the provisions above and replace them with the notice
34
* and other provisions required by the GPL or the LGPL. If you do not delete
35
* the provisions above, a recipient may use your version of this file under
36
* the terms of any one of the MPL, the GPL or the LGPL.
38
* ***** END LICENSE BLOCK ***** */
40
/* @(#)fdlibm.h 1.5 95/01/18 */
42
* ====================================================
43
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
45
* Developed at SunSoft, a Sun Microsystems, Inc. business.
46
* Permission to use, copy, modify, and distribute this
47
* software is freely granted, provided that this notice
49
* ====================================================
52
/* Modified defines start here.. */
53
#undef __LITTLE_ENDIAN
57
#define __LITTLE_ENDIAN
61
#define __LITTLE_ENDIAN
64
#if defined(linux) && (defined(__i386__) || defined(__x86_64__) || defined(__ia64) || (defined(__mips) && defined(__MIPSEL__)))
65
#define __LITTLE_ENDIAN
68
/* End here. The rest is the standard file. */
70
#ifdef SOLARIS /* special setup for Sun test regime */
71
#if defined(i386) || defined(i486) || \
72
defined(intel) || defined(x86) || defined(i86pc)
73
#define __LITTLE_ENDIAN
78
#ifdef __LITTLE_ENDIAN
79
struct { int lo, hi; } ints;
81
struct { int hi, lo; } ints;
86
#define __HI(x) x.ints.hi
87
#define __LO(x) x.ints.lo
102
#define MAXFLOAT ((float)3.40282346638528860e+38)
104
enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix};
106
#define _LIB_VERSION_TYPE enum fdversion
107
#define _LIB_VERSION _fdlib_version
109
/* if global variable _LIB_VERSION is not desirable, one may
110
* change the following to be a constant by:
111
* #define _LIB_VERSION_TYPE const enum version
112
* In that case, after one initializes the value _LIB_VERSION (see
113
* s_lib_version.c) during compile time, it cannot be modified
114
* in the middle of a program
116
extern _LIB_VERSION_TYPE _LIB_VERSION;
118
#define _IEEE_ fdlibm_ieee
119
#define _SVID_ fdlibm_svid
120
#define _XOPEN_ fdlibm_xopen
121
#define _POSIX_ fdlibm_posix
131
#define HUGE MAXFLOAT
134
* set X_TLOSS = pi*2**52, which is possibly defined in <values.h>
135
* (one may replace the following line by "#include <values.h>")
138
#define X_TLOSS 1.41484755040568800000e+16
151
extern double fd_acos __P((double));
152
extern double fd_asin __P((double));
153
extern double fd_atan __P((double));
154
extern double fd_atan2 __P((double, double));
155
extern double fd_cos __P((double));
156
extern double fd_sin __P((double));
157
extern double fd_tan __P((double));
159
extern double fd_cosh __P((double));
160
extern double fd_sinh __P((double));
161
extern double fd_tanh __P((double));
163
extern double fd_exp __P((double));
164
extern double fd_frexp __P((double, int *));
165
extern double fd_ldexp __P((double, int));
166
extern double fd_log __P((double));
167
extern double fd_log10 __P((double));
168
extern double fd_modf __P((double, double *));
170
extern double fd_pow __P((double, double));
171
extern double fd_sqrt __P((double));
173
extern double fd_ceil __P((double));
174
extern double fd_fabs __P((double));
175
extern double fd_floor __P((double));
176
extern double fd_fmod __P((double, double));
178
extern double fd_erf __P((double));
179
extern double fd_erfc __P((double));
180
extern double fd_gamma __P((double));
181
extern double fd_hypot __P((double, double));
182
extern int fd_isnan __P((double));
183
extern int fd_finite __P((double));
184
extern double fd_j0 __P((double));
185
extern double fd_j1 __P((double));
186
extern double fd_jn __P((int, double));
187
extern double fd_lgamma __P((double));
188
extern double fd_y0 __P((double));
189
extern double fd_y1 __P((double));
190
extern double fd_yn __P((int, double));
192
extern double fd_acosh __P((double));
193
extern double fd_asinh __P((double));
194
extern double fd_atanh __P((double));
195
extern double fd_cbrt __P((double));
196
extern double fd_logb __P((double));
197
extern double fd_nextafter __P((double, double));
198
extern double fd_remainder __P((double, double));
200
extern double fd_scalb __P((double, int));
202
extern double fd_scalb __P((double, double));
205
extern int fd_matherr __P((struct exception *));
210
extern double significand __P((double));
213
* Functions callable from C, intended to support IEEE arithmetic.
215
extern double fd_copysign __P((double, double));
216
extern int fd_ilogb __P((double));
217
extern double fd_rint __P((double));
218
extern double fd_scalbn __P((double, int));
221
* BSD math library entry points
223
extern double fd_expm1 __P((double));
224
extern double fd_log1p __P((double));
227
* Reentrant version of gamma & lgamma; passes signgam back by reference
228
* as the second argument; user must allocate space for signgam.
231
extern double gamma_r __P((double, int *));
232
extern double lgamma_r __P((double, int *));
233
#endif /* _REENTRANT */
235
/* ieee style elementary functions */
236
extern double __ieee754_sqrt __P((double));
237
extern double __ieee754_acos __P((double));
238
extern double __ieee754_acosh __P((double));
239
extern double __ieee754_log __P((double));
240
extern double __ieee754_atanh __P((double));
241
extern double __ieee754_asin __P((double));
242
extern double __ieee754_atan2 __P((double,double));
243
extern double __ieee754_exp __P((double));
244
extern double __ieee754_cosh __P((double));
245
extern double __ieee754_fmod __P((double,double));
246
extern double __ieee754_pow __P((double,double));
247
extern double __ieee754_lgamma_r __P((double,int *));
248
extern double __ieee754_gamma_r __P((double,int *));
249
extern double __ieee754_lgamma __P((double));
250
extern double __ieee754_gamma __P((double));
251
extern double __ieee754_log10 __P((double));
252
extern double __ieee754_sinh __P((double));
253
extern double __ieee754_hypot __P((double,double));
254
extern double __ieee754_j0 __P((double));
255
extern double __ieee754_j1 __P((double));
256
extern double __ieee754_y0 __P((double));
257
extern double __ieee754_y1 __P((double));
258
extern double __ieee754_jn __P((int,double));
259
extern double __ieee754_yn __P((int,double));
260
extern double __ieee754_remainder __P((double,double));
261
extern int __ieee754_rem_pio2 __P((double,double*));
263
extern double __ieee754_scalb __P((double,int));
265
extern double __ieee754_scalb __P((double,double));
268
/* fdlibm kernel function */
269
extern double __kernel_standard __P((double,double,int,int*));
270
extern double __kernel_sin __P((double,double,int));
271
extern double __kernel_cos __P((double,double));
272
extern double __kernel_tan __P((double,double,int));
273
extern int __kernel_rem_pio2 __P((double*,double*,int,int,int,const int*));