Root/
Source at commit 1275 created 12 years 11 months ago. By meklort, Remove unused file. Fixup makefiles some more - boot2 compiles again. | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.␊ |
3 | *␊ |
4 | * @APPLE_LICENSE_HEADER_START@␊ |
5 | * ␊ |
6 | * The contents of this file constitute Original Code as defined in and␊ |
7 | * are subject to the Apple Public Source License Version 1.1 (the␊ |
8 | * "License"). You may not use this file except in compliance with the␊ |
9 | * License. Please obtain a copy of the License at␊ |
10 | * http://www.apple.com/publicsource and read it before using this file.␊ |
11 | * ␊ |
12 | * This Original Code and all software distributed under the License are␊ |
13 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the␊ |
17 | * License for the specific language governing rights and limitations␊ |
18 | * under the License.␊ |
19 | * ␊ |
20 | * @APPLE_LICENSE_HEADER_END@␊ |
21 | */␊ |
22 | ␊ |
23 | /*******************************************************************************␊ |
24 | * *␊ |
25 | * File: math.h *␊ |
26 | * *␊ |
27 | * Contains: typedefs, prototypes, and macros germane to C99 floating point.*␊ |
28 | * *␊ |
29 | *******************************************************************************/␊ |
30 | #ifndef __MATH__␊ |
31 | #define __MATH__␊ |
32 | ␊ |
33 | #ifdef __cplusplus␊ |
34 | extern "C" {␊ |
35 | #endif␊ |
36 | ␊ |
37 | /******************************************************************************␊ |
38 | * Floating point data types *␊ |
39 | ******************************************************************************/␊ |
40 | ␊ |
41 | /* Define float_t and double_t per C standard, ISO/IEC 9899:1999 7.12 2,␊ |
42 | taking advantage of GCC's __FLT_EVAL_METHOD__ (which a compiler may␊ |
43 | define anytime and GCC does) that shadows FLT_EVAL_METHOD (which a compiler␊ |
44 | must and may define only in float.h).␊ |
45 | */␊ |
46 | #if __FLT_EVAL_METHOD__ == 0␊ |
47 | typedef float float_t;␊ |
48 | typedef double double_t;␊ |
49 | #elif __FLT_EVAL_METHOD__ == 1␊ |
50 | typedef double float_t;␊ |
51 | typedef double double_t;␊ |
52 | #elif __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ == -1␊ |
53 | typedef long double float_t;␊ |
54 | typedef long double double_t;␊ |
55 | #else /* __FLT_EVAL_METHOD__ */␊ |
56 | #error "Unsupported value of __FLT_EVAL_METHOD__."␊ |
57 | #endif /* __FLT_EVAL_METHOD__ */␊ |
58 | ␊ |
59 | ␊ |
60 | #if defined(__GNUC__)␊ |
61 | #define HUGE_VAL __builtin_huge_val()␊ |
62 | #define HUGE_VALF __builtin_huge_valf()␊ |
63 | #define HUGE_VALL __builtin_huge_vall()␊ |
64 | #define NAN __builtin_nanf("0x7fc00000") /* Constant expression, can be used as initializer. */␊ |
65 | #define __MATH_H_ALWAYS_INLINE__ __attribute__ ((__always_inline__))␊ |
66 | ␊ |
67 | #if defined( __LONG_DOUBLE_128__ )␊ |
68 | // This is the arm Libm header. Arm has 64-bit long doubles. ␊ |
69 | // If you are trying to build for Intel or PowerPC this is not the right header.␊ |
70 | #error This math library does not support 128-bit long doubles ␊ |
71 | #endif␊ |
72 | #else␊ |
73 | #define HUGE_VAL 1e500␊ |
74 | #define HUGE_VALF 1e50f␊ |
75 | #define HUGE_VALL 1e5000L␊ |
76 | #define NAN __nan( )␊ |
77 | #define __MATH_H_ALWAYS_INLINE__␊ |
78 | #endif␊ |
79 | ␊ |
80 | #define INFINITY HUGE_VALF␊ |
81 | ␊ |
82 | ␊ |
83 | /******************************************************************************␊ |
84 | * Taxonomy of floating point data types *␊ |
85 | ******************************************************************************/␊ |
86 | ␊ |
87 | #define FP_NAN 1␊ |
88 | #define FP_INFINITE 2␊ |
89 | #define FP_ZERO 3␊ |
90 | #define FP_NORMAL 4␊ |
91 | #define FP_SUBNORMAL 5␊ |
92 | #define FP_SUPERNORMAL 6 /* meaningful only on PowerPC */␊ |
93 | ␊ |
94 | /* fma() *function call* is more costly than equivalent (in-line) multiply and add operations */␊ |
95 | /* For single and double precision, the cost isn't too bad, because we can fall back on higher */␊ |
96 | /* precision hardware, with the necessary range to handle infinite precision products. However, */␊ |
97 | /* expect the long double fma to be at least an order of magnitude slower than a simple multiply */␊ |
98 | /* and an add. */␊ |
99 | #undef FP_FAST_FMA␊ |
100 | #undef FP_FAST_FMAF␊ |
101 | #undef FP_FAST_FMAL␊ |
102 | ␊ |
103 | /* The values returned by `ilogb' for 0 and NaN respectively. */␊ |
104 | #define FP_ILOGB0 (-2147483647 - 1)␊ |
105 | #define FP_ILOGBNAN (-2147483647 - 1)␊ |
106 | ␊ |
107 | /* Bitmasks for the math_errhandling macro. */␊ |
108 | #define MATH_ERRNO 1 /* errno set by math functions. */␊ |
109 | #define MATH_ERREXCEPT 2 /* Exceptions raised by math functions. */␊ |
110 | ␊ |
111 | #define math_errhandling (__math_errhandling())␊ |
112 | extern int __math_errhandling ( void );␊ |
113 | ␊ |
114 | /********************************************************************************␊ |
115 | * *␊ |
116 | * Inquiry macros *␊ |
117 | * *␊ |
118 | * fpclassify Returns one of the FP_* values. *␊ |
119 | * isnormal Non-zero if and only if the argument x is normalized. *␊ |
120 | * isfinite Non-zero if and only if the argument x is finite. *␊ |
121 | * isnan Non-zero if and only if the argument x is a NaN. *␊ |
122 | * signbit Non-zero if and only if the sign of the argument x is *␊ |
123 | * negative. This includes, NaNs, infinities and zeros. *␊ |
124 | * *␊ |
125 | ********************************************************************************/␊ |
126 | ␊ |
127 | #define fpclassify(x) \␊ |
128 | ( sizeof (x) == sizeof(float ) ? __fpclassifyf((float)(x)) \␊ |
129 | : sizeof (x) == sizeof(double) ? __fpclassify((double)(x)) \␊ |
130 | : __fpclassifyl ((long double)(x)))␊ |
131 | ␊ |
132 | extern int __fpclassifyf(float );␊ |
133 | extern int __fpclassify(double );␊ |
134 | extern int __fpclassifyl(long double);␊ |
135 | ␊ |
136 | ␊ |
137 | /* ␊ |
138 | Note that these inline functions will fail to return expected results if you turn on unsafe math optimization flags, ␊ |
139 | including -ffast-math. This is not a bug. You have explicitly told the compiler that NaN's and Infs never happen.␊ |
140 | As a result, the compiler simply assumes that they can't happen and things like isnan() return false even when␊ |
141 | presented with a NaN.␊ |
142 | */␊ |
143 | #define isnormal(x) \␊ |
144 | ( sizeof (x) == sizeof(float ) ? __inline_isnormalf((float)(x)) \␊ |
145 | : sizeof (x) == sizeof(double) ? __inline_isnormald((double)(x)) \␊ |
146 | : __inline_isnormal ((long double)(x)))␊ |
147 | ␊ |
148 | #define isfinite(x) \␊ |
149 | ( sizeof (x) == sizeof(float ) ? __inline_isfinitef((float)(x)) \␊ |
150 | : sizeof (x) == sizeof(double) ? __inline_isfinited((double)(x)) \␊ |
151 | : __inline_isfinite ((long double)(x)))␊ |
152 | ␊ |
153 | #define isinf(x) \␊ |
154 | ( sizeof (x) == sizeof(float ) ? __inline_isinff((float)(x)) \␊ |
155 | : sizeof (x) == sizeof(double) ? __inline_isinfd((double)(x)) \␊ |
156 | : __inline_isinf ((long double)(x)))␊ |
157 | ␊ |
158 | #define isnan(x) \␊ |
159 | ( sizeof (x) == sizeof(float ) ? __inline_isnanf((float)(x)) \␊ |
160 | : sizeof (x) == sizeof(double) ? __inline_isnand((double)(x)) \␊ |
161 | : __inline_isnan ((long double)(x)))␊ |
162 | ␊ |
163 | #define signbit(x) \␊ |
164 | ( sizeof (x) == sizeof(float ) ? __inline_signbitf((float)(x)) \␊ |
165 | : sizeof (x) == sizeof(double) ? __inline_signbitd((double)(x)) \␊ |
166 | : __inline_signbit((long double)(x)))␊ |
167 | ␊ |
168 | static __inline__ int __inline_isfinitef (float ) __MATH_H_ALWAYS_INLINE__;␊ |
169 | static __inline__ int __inline_isfinited (double ) __MATH_H_ALWAYS_INLINE__;␊ |
170 | static __inline__ int __inline_isfinite (long double) __MATH_H_ALWAYS_INLINE__;␊ |
171 | static __inline__ int __inline_isinff (float ) __MATH_H_ALWAYS_INLINE__;␊ |
172 | static __inline__ int __inline_isinfd (double ) __MATH_H_ALWAYS_INLINE__;␊ |
173 | static __inline__ int __inline_isinf (long double) __MATH_H_ALWAYS_INLINE__;␊ |
174 | static __inline__ int __inline_isnanf (float ) __MATH_H_ALWAYS_INLINE__;␊ |
175 | static __inline__ int __inline_isnand (double ) __MATH_H_ALWAYS_INLINE__;␊ |
176 | static __inline__ int __inline_isnan (long double) __MATH_H_ALWAYS_INLINE__;␊ |
177 | static __inline__ int __inline_isnormalf (float ) __MATH_H_ALWAYS_INLINE__;␊ |
178 | static __inline__ int __inline_isnormald (double ) __MATH_H_ALWAYS_INLINE__;␊ |
179 | static __inline__ int __inline_isnormal (long double) __MATH_H_ALWAYS_INLINE__;␊ |
180 | static __inline__ int __inline_signbitf (float ) __MATH_H_ALWAYS_INLINE__;␊ |
181 | static __inline__ int __inline_signbitd (double ) __MATH_H_ALWAYS_INLINE__;␊ |
182 | static __inline__ int __inline_signbit (long double) __MATH_H_ALWAYS_INLINE__;␊ |
183 | ␊ |
184 | static __inline__ int __inline_isinff( float __x ) { return __builtin_fabsf(__x) == __builtin_inff(); }␊ |
185 | static __inline__ int __inline_isinfd( double __x ) { return __builtin_fabs(__x) == __builtin_inf(); }␊ |
186 | static __inline__ int __inline_isinf( long double __x ) { return __builtin_fabsl(__x) == __builtin_infl(); }␊ |
187 | static __inline__ int __inline_isfinitef( float __x ) { return __x == __x && __builtin_fabsf(__x) != __builtin_inff(); }␊ |
188 | static __inline__ int __inline_isfinited( double __x ) { return __x == __x && __builtin_fabs(__x) != __builtin_inf(); }␊ |
189 | static __inline__ int __inline_isfinite( long double __x ) { return __x == __x && __builtin_fabsl(__x) != __builtin_infl(); }␊ |
190 | static __inline__ int __inline_isnanf( float __x ) { return __x != __x; }␊ |
191 | static __inline__ int __inline_isnand( double __x ) { return __x != __x; }␊ |
192 | static __inline__ int __inline_isnan( long double __x ) { return __x != __x; }␊ |
193 | static __inline__ int __inline_signbitf( float __x ) { union{ float __f; unsigned int __u; }__u; __u.__f = __x; return (int)(__u.__u >> 31); }␊ |
194 | static __inline__ int __inline_signbitd( double __x ) { union{ double __f; unsigned long long __u; }__u; __u.__f = __x; return (int)(__u.__u >> 63); }␊ |
195 | static __inline__ int __inline_signbit( long double __x ){ union{ double __f; unsigned long long __u; }__u; __u.__f = __x; return (int)(__u.__u >> 63); } ␊ |
196 | static __inline__ int __inline_isnormalf( float __x ) { float fabsf = __builtin_fabsf(__x); if( __x != __x ) return 0; return fabsf < __builtin_inff() && fabsf >= __FLT_MIN__; } ␊ |
197 | static __inline__ int __inline_isnormald( double __x ) { double fabsf = __builtin_fabs(__x); if( __x != __x ) return 0; return fabsf < __builtin_inf() && fabsf >= __DBL_MIN__; } ␊ |
198 | static __inline__ int __inline_isnormal( long double __x ) { long double fabsf = __builtin_fabsl(__x); if( __x != __x ) return 0; return fabsf < __builtin_infl() && fabsf >= __LDBL_MIN__; } ␊ |
199 | ␊ |
200 | ␊ |
201 | ␊ |
202 | /********************************************************************************␊ |
203 | * *␊ |
204 | * Math Functions *␊ |
205 | * *␊ |
206 | ********************************************************************************/␊ |
207 | ␊ |
208 | extern double acos( double );␊ |
209 | extern float acosf( float );␊ |
210 | ␊ |
211 | extern double asin( double );␊ |
212 | extern float asinf( float );␊ |
213 | ␊ |
214 | extern double atan( double );␊ |
215 | extern float atanf( float );␊ |
216 | ␊ |
217 | extern double atan2( double, double );␊ |
218 | extern float atan2f( float, float );␊ |
219 | ␊ |
220 | extern double cos( double );␊ |
221 | extern float cosf( float );␊ |
222 | ␊ |
223 | extern double sin( double );␊ |
224 | extern float sinf( float );␊ |
225 | ␊ |
226 | extern double tan( double );␊ |
227 | extern float tanf( float );␊ |
228 | ␊ |
229 | extern double acosh( double );␊ |
230 | extern float acoshf( float );␊ |
231 | ␊ |
232 | extern double asinh( double );␊ |
233 | extern float asinhf( float );␊ |
234 | ␊ |
235 | extern double atanh( double );␊ |
236 | extern float atanhf( float );␊ |
237 | ␊ |
238 | extern double cosh( double );␊ |
239 | extern float coshf( float );␊ |
240 | ␊ |
241 | extern double sinh( double );␊ |
242 | extern float sinhf( float );␊ |
243 | ␊ |
244 | extern double tanh( double );␊ |
245 | extern float tanhf( float );␊ |
246 | ␊ |
247 | extern double exp ( double );␊ |
248 | extern float expf ( float );␊ |
249 | ␊ |
250 | extern double exp2 ( double ); ␊ |
251 | extern float exp2f ( float );␊ |
252 | ␊ |
253 | extern double expm1 ( double ); ␊ |
254 | extern float expm1f ( float );␊ |
255 | ␊ |
256 | extern double log ( double );␊ |
257 | extern float logf ( float );␊ |
258 | ␊ |
259 | extern double log10 ( double );␊ |
260 | extern float log10f ( float );␊ |
261 | ␊ |
262 | extern double log2 ( double );␊ |
263 | extern float log2f ( float );␊ |
264 | ␊ |
265 | extern double log1p ( double );␊ |
266 | extern float log1pf ( float );␊ |
267 | ␊ |
268 | extern double logb ( double );␊ |
269 | extern float logbf ( float );␊ |
270 | ␊ |
271 | extern double modf ( double, double * );␊ |
272 | extern float modff ( float, float * );␊ |
273 | ␊ |
274 | extern double ldexp ( double, int );␊ |
275 | extern float ldexpf ( float, int );␊ |
276 | ␊ |
277 | extern double frexp ( double, int * );␊ |
278 | extern float frexpf ( float, int * );␊ |
279 | ␊ |
280 | extern int ilogb ( double );␊ |
281 | extern int ilogbf ( float );␊ |
282 | ␊ |
283 | extern double scalbn ( double, int );␊ |
284 | extern float scalbnf ( float, int );␊ |
285 | ␊ |
286 | extern double scalbln ( double, long int );␊ |
287 | extern float scalblnf ( float, long int );␊ |
288 | ␊ |
289 | extern double fabs( double );␊ |
290 | extern float fabsf( float );␊ |
291 | ␊ |
292 | extern double cbrt( double );␊ |
293 | extern float cbrtf( float );␊ |
294 | ␊ |
295 | extern double hypot ( double, double );␊ |
296 | extern float hypotf ( float, float );␊ |
297 | ␊ |
298 | extern double pow ( double, double );␊ |
299 | extern float powf ( float, float );␊ |
300 | ␊ |
301 | extern double sqrt( double );␊ |
302 | extern float sqrtf( float );␊ |
303 | ␊ |
304 | extern double erf( double );␊ |
305 | extern float erff( float );␊ |
306 | ␊ |
307 | extern double erfc( double );␊ |
308 | extern float erfcf( float );␊ |
309 | ␊ |
310 | /*␉lgamma and lgammaf are not thread-safe. The thread-safe variants lgamma_r and lgammaf_r␊ |
311 | ␉are available if _REENTRANT symbol is defined␊ |
312 | */␊ |
313 | extern double lgamma( double );␊ |
314 | extern float lgammaf( float );␊ |
315 | ␊ |
316 | extern double tgamma( double );␊ |
317 | extern float tgammaf( float );␊ |
318 | ␊ |
319 | extern double ceil ( double );␊ |
320 | extern float ceilf ( float );␊ |
321 | ␊ |
322 | extern double floor ( double );␊ |
323 | extern float floorf ( float );␊ |
324 | ␊ |
325 | extern double nearbyint ( double );␊ |
326 | extern float nearbyintf ( float );␊ |
327 | ␊ |
328 | extern double rint ( double );␊ |
329 | extern float rintf ( float );␊ |
330 | ␊ |
331 | extern long int lrint ( double );␊ |
332 | extern long int lrintf ( float );␊ |
333 | ␊ |
334 | extern double round ( double );␊ |
335 | extern float roundf ( float );␊ |
336 | ␊ |
337 | extern long int lround ( double );␊ |
338 | extern long int lroundf ( float );␊ |
339 | ␊ |
340 | #if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ )␊ |
341 | ␊ |
342 | /* long long is not part of C90. Make sure you are passing -std=c99 or -std=gnu99 or better if you need this. */␊ |
343 | extern long long int llrint ( double );␊ |
344 | extern long long int llrintf ( float );␊ |
345 | ␊ |
346 | extern long long int llround ( double );␊ |
347 | extern long long int llroundf ( float );␊ |
348 | ␊ |
349 | #endif /* #if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ ) */␊ |
350 | ␊ |
351 | extern double trunc ( double );␊ |
352 | extern float truncf ( float );␊ |
353 | ␊ |
354 | extern double fmod ( double, double );␊ |
355 | extern float fmodf ( float, float );␊ |
356 | ␊ |
357 | extern double remainder ( double, double );␊ |
358 | extern float remainderf ( float, float );␊ |
359 | ␊ |
360 | extern double remquo ( double, double, int * );␊ |
361 | extern float remquof ( float, float, int * );␊ |
362 | ␊ |
363 | extern double copysign ( double, double );␊ |
364 | extern float copysignf ( float, float );␊ |
365 | ␊ |
366 | extern double nan( const char * );␊ |
367 | extern float nanf( const char * );␊ |
368 | ␊ |
369 | extern double nextafter ( double, double );␊ |
370 | extern float nextafterf ( float, float );␊ |
371 | ␊ |
372 | extern double fdim ( double, double );␊ |
373 | extern float fdimf ( float, float );␊ |
374 | ␊ |
375 | extern double fmax ( double, double );␊ |
376 | extern float fmaxf ( float, float );␊ |
377 | ␊ |
378 | extern double fmin ( double, double );␊ |
379 | extern float fminf ( float, float );␊ |
380 | ␊ |
381 | extern double fma ( double, double, double );␊ |
382 | extern float fmaf ( float, float, float );␊ |
383 | ␊ |
384 | extern long double acosl(long double);␊ |
385 | extern long double asinl(long double);␊ |
386 | extern long double atanl(long double);␊ |
387 | extern long double atan2l(long double, long double);␊ |
388 | extern long double cosl(long double);␊ |
389 | extern long double sinl(long double);␊ |
390 | extern long double tanl(long double);␊ |
391 | extern long double acoshl(long double);␊ |
392 | extern long double asinhl(long double);␊ |
393 | extern long double atanhl(long double);␊ |
394 | extern long double coshl(long double);␊ |
395 | extern long double sinhl(long double);␊ |
396 | extern long double tanhl(long double);␊ |
397 | extern long double expl(long double);␊ |
398 | extern long double exp2l(long double);␊ |
399 | extern long double expm1l(long double);␊ |
400 | extern long double logl(long double);␊ |
401 | extern long double log10l(long double);␊ |
402 | extern long double log2l(long double);␊ |
403 | extern long double log1pl(long double);␊ |
404 | extern long double logbl(long double);␊ |
405 | extern long double modfl(long double, long double *);␊ |
406 | extern long double ldexpl(long double, int);␊ |
407 | extern long double frexpl(long double, int *);␊ |
408 | extern int ilogbl(long double);␊ |
409 | extern long double scalbnl(long double, int);␊ |
410 | extern long double scalblnl(long double, long int);␊ |
411 | extern long double fabsl(long double);␊ |
412 | extern long double cbrtl(long double);␊ |
413 | extern long double hypotl(long double, long double);␊ |
414 | extern long double powl(long double, long double);␊ |
415 | extern long double sqrtl(long double);␊ |
416 | extern long double erfl(long double);␊ |
417 | extern long double erfcl(long double);␊ |
418 | /*␉lgammal is not thread-safe. The thread-safe variant lgammal_r is available if _REENTRANT symbol is defined */␊ |
419 | extern long double lgammal(long double);␊ |
420 | extern long double tgammal(long double);␊ |
421 | extern long double ceill(long double);␊ |
422 | extern long double floorl(long double);␊ |
423 | extern long double nearbyintl(long double);␊ |
424 | extern long double rintl(long double);␊ |
425 | extern long int lrintl(long double);␊ |
426 | extern long double roundl(long double);␊ |
427 | extern long int lroundl(long double);␊ |
428 | ␊ |
429 | #if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ )␊ |
430 | // long long is not part of C90. Make sure you are passing -std=c99 or -std=gnu99 or better if you need this. ␊ |
431 | extern long long int llrintl(long double);␊ |
432 | extern long long int llroundl(long double);␊ |
433 | #endif ␊ |
434 | ␊ |
435 | extern long double truncl(long double);␊ |
436 | extern long double fmodl(long double, long double);␊ |
437 | extern long double remainderl(long double, long double);␊ |
438 | extern long double remquol(long double, long double, int *);␊ |
439 | extern long double copysignl(long double, long double);␊ |
440 | extern long double nanl(const char *);␊ |
441 | extern long double nextafterl(long double, long double);␊ |
442 | extern double nexttoward(double, long double);␊ |
443 | extern float nexttowardf(float, long double);␊ |
444 | extern long double nexttowardl(long double, long double);␊ |
445 | extern long double fdiml(long double, long double);␊ |
446 | extern long double fmaxl(long double, long double);␊ |
447 | extern long double fminl(long double, long double);␊ |
448 | extern long double fmal(long double, long double, long double);␊ |
449 | ␊ |
450 | #define isgreater(x, y) __builtin_isgreater ((x),(y))␊ |
451 | #define isgreaterequal(x, y) __builtin_isgreaterequal ((x),(y))␊ |
452 | #define isless(x, y) __builtin_isless ((x),(y))␊ |
453 | #define islessequal(x, y) __builtin_islessequal ((x),(y))␊ |
454 | #define islessgreater(x, y) __builtin_islessgreater ((x),(y))␊ |
455 | #define isunordered(x, y) __builtin_isunordered ((x),(y))␊ |
456 | ␊ |
457 | ␊ |
458 | #if !defined(_ANSI_SOURCE)␊ |
459 | ␊ |
460 | /* ␊ |
461 | * set X_TLOSS = pi*2**52, which is possibly defined in <values.h>␊ |
462 | * (one may replace the following line by "#include <values.h>")␊ |
463 | */␊ |
464 | ␊ |
465 | #define X_TLOSS␉␉1.41484755040568800000e+16 ␊ |
466 | ␊ |
467 | ␊ |
468 | extern double j0 ( double );␊ |
469 | extern double j1 ( double );␊ |
470 | extern double jn ( int, double ); ␊ |
471 | extern double y0 ( double );␊ |
472 | extern double y1 ( double );␊ |
473 | extern double yn ( int, double ); ␊ |
474 | ␊ |
475 | extern double scalb ( double, double ); ␊ |
476 | extern int signgam; /* required for unix 2003 */␊ |
477 | ␊ |
478 | /*␊ |
479 | * Constants required by UNIX 2003 / POSIX: ␊ |
480 | *␊ |
481 | * http://www.opengroup.org/onlinepubs/007908799/xsh/math.h.html␊ |
482 | *␊ |
483 | * Even though these would be more useful as long double, POSIX requires these to be double.␊ |
484 | */␊ |
485 | #define M_E 2.71828182845904523536028747135266250 /* e */␊ |
486 | #define M_LOG2E 1.44269504088896340735992468100189214 /* log2(e) */␊ |
487 | #define M_LOG10E 0.434294481903251827651128918916605082 /* log10(e) */␊ |
488 | #define M_LN2 0.693147180559945309417232121458176568 /* loge(2) */␊ |
489 | #define M_LN10 2.30258509299404568401799145468436421 /* loge(10) */␊ |
490 | #define M_PI 3.14159265358979323846264338327950288 /* pi */␊ |
491 | #define M_PI_2 1.57079632679489661923132169163975144 /* pi/2 */␊ |
492 | #define M_PI_4 0.785398163397448309615660845819875721 /* pi/4 */␊ |
493 | #define M_1_PI 0.318309886183790671537767526745028724 /* 1/pi */␊ |
494 | #define M_2_PI 0.636619772367581343075535053490057448 /* 2/pi */␊ |
495 | #define M_2_SQRTPI 1.12837916709551257389615890312154517 /* 2/sqrt(pi) */␊ |
496 | #define M_SQRT2 1.41421356237309504880168872420969808 /* sqrt(2) */␊ |
497 | #define M_SQRT1_2 0.707106781186547524400844362104849039 /* 1/sqrt(2) */␊ |
498 | ␊ |
499 | #define MAXFLOAT 0x1.fffffep+127f␊ |
500 | ␊ |
501 | ␊ |
502 | #endif /* !defined(_ANSI_SOURCE) */␊ |
503 | ␊ |
504 | ␉␊ |
505 | ␉␊ |
506 | #if !defined(__NOEXTENSIONS__) && !defined(__STRICT_ANSI__) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))␊ |
507 | #ifdef _REENTRANT␊ |
508 | ␉␊ |
509 | ␉/* Thread safe variants of the lgamma[fl]_r functions. */␊ |
510 | ␉␊ |
511 | extern float lgammaf_r(float, int *);␊ |
512 | extern double lgamma_r(double, int *);␊ |
513 | extern long double lgammal_r(long double, int *);␊ |
514 | #endif // _REENTRANT␊ |
515 | #endif // !defined(__NOEXTENSIONS__) && !defined(__STRICT_ANSI__) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))␊ |
516 | ␉␊ |
517 | ␉␊ |
518 | ␊ |
519 | #ifdef __cplusplus␊ |
520 | }␊ |
521 | #endif␊ |
522 | ␊ |
523 | #endif /* __MATH__ */␊ |
524 |