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
* Netscape Communications Corporation.
21
* Portions created by the Initial Developer are Copyright (C) 1998
22
* the Initial Developer. All Rights Reserved.
27
* Alternatively, the contents of this file may be used under the terms of
28
* either of the GNU General Public License Version 2 or later (the "GPL"),
29
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30
* in which case the provisions of the GPL or the LGPL are applicable instead
31
* of those above. If you wish to allow use of your version of this file only
32
* under the terms of either the GPL or the LGPL, and not to allow others to
33
* use your version of this file under the terms of the MPL, indicate your
34
* decision by deleting the provisions above and replace them with the notice
35
* and other provisions required by the GPL or the LGPL. If you do not delete
36
* the provisions above, a recipient may use your version of this file under
37
* the terms of any one of the MPL, the GPL or the LGPL.
39
* ***** END LICENSE BLOCK ***** */
42
* By default all math calls go to fdlibm. The defines for each platform
43
* remap the math calls to native routines.
53
* Define which platforms on which to use fdlibm. Not used
54
* by default since there can be problems with endian-ness and such.
57
#if defined(_WIN32) && !defined(__MWERKS__)
58
#define JS_USE_FDLIBM_MATH 1
61
#define JS_USE_FDLIBM_MATH 1
64
#define JS_USE_FDLIBM_MATH 1
66
#elif defined(SOLARIS)
67
#define JS_USE_FDLIBM_MATH 1
70
#define JS_USE_FDLIBM_MATH 1
73
#define JS_USE_FDLIBM_MATH 1
76
/* Want to use some fdlibm functions but fdlibm broken on OSF1/alpha. */
77
#define JS_USE_FDLIBM_MATH 0
80
#define JS_USE_FDLIBM_MATH 1
83
#define JS_USE_FDLIBM_MATH 0
86
#if !JS_USE_FDLIBM_MATH
89
* Use system provided math routines.
95
#define fd_atan2 atan2
97
#define fd_copysign copysign
101
#define fd_floor floor
112
* Use math routines in fdlibm.
122
#if defined _WIN32 || defined SUNOS4
135
#define fd_floor floor
138
extern double fd_atan2 __P((double, double));
139
extern double fd_copysign __P((double, double));
140
extern double fd_pow __P((double, double));
149
#define fd_log10 log10
152
#define fd_floor floor
155
extern double fd_cos __P((double));
156
extern double fd_sin __P((double));
157
extern double fd_tan __P((double));
158
extern double fd_atan2 __P((double, double));
159
extern double fd_pow __P((double, double));
160
extern double fd_ceil __P((double));
161
extern double fd_copysign __P((double, double));
163
#elif defined SOLARIS
173
#define fd_floor floor
176
extern double fd_acos __P((double));
177
extern double fd_asin __P((double));
178
extern double fd_log __P((double));
179
extern double fd_atan2 __P((double, double));
180
extern double fd_pow __P((double, double));
181
extern double fd_copysign __P((double, double));
190
#define fd_floor floor
193
extern double fd_ceil __P((double));
194
extern double fd_acos __P((double));
195
extern double fd_log __P((double));
196
extern double fd_atan2 __P((double, double));
197
extern double fd_tan __P((double));
198
extern double fd_pow __P((double, double));
199
extern double fd_asin __P((double));
200
extern double fd_atan __P((double));
201
extern double fd_copysign __P((double, double));
206
#define fd_atan2 atan2
210
#define fd_floor floor
215
#define fd_copysign copysign
217
extern double fd_asin __P((double));
218
extern double fd_acos __P((double));
219
extern double fd_exp __P((double));
220
extern double fd_log __P((double));
221
extern double fd_pow __P((double, double));
228
#define fd_copysign copysign
237
extern double fd_atan2 __P((double, double));
238
extern double fd_ceil __P((double));
239
extern double fd_floor __P((double));
240
extern double fd_log __P((double));
241
extern double fd_pow __P((double, double));
247
#define fd_atan2 atan2
248
#define fd_copysign copysign
252
#define fd_floor floor
258
extern double fd_atan __P((double));
259
extern double fd_ceil __P((double));
260
extern double fd_pow __P((double,double));
261
extern double fd_tan __P((double));
263
#else /* other platform.. generic paranoid slow fdlibm */
265
extern double fd_acos __P((double));
266
extern double fd_asin __P((double));
267
extern double fd_atan __P((double));
268
extern double fd_cos __P((double));
269
extern double fd_sin __P((double));
270
extern double fd_tan __P((double));
272
extern double fd_exp __P((double));
273
extern double fd_log __P((double));
274
extern double fd_sqrt __P((double));
276
extern double fd_ceil __P((double));
277
extern double fd_fabs __P((double));
278
extern double fd_floor __P((double));
279
extern double fd_fmod __P((double, double));
281
extern double fd_atan2 __P((double, double));
282
extern double fd_pow __P((double, double));
283
extern double fd_copysign __P((double, double));
287
#endif /* JS_USE_FDLIBM_MATH */
289
#endif /* _LIBMATH_H */