VirtualBox

root/trunk/include/iprt/nocrt/math.h

Revision 8245, 27.4 kB (checked in by vboxsync, 9 months ago)

rebranding: IPRT files again.

  • Property svn:eol-style set to native
Line 
1 /** @file
2  * IPRT / No-CRT - math.h.
3  */
4
5 /*
6  * Copyright (C) 2006-2007 Sun Microsystems, Inc.
7  *
8  * This file is part of VirtualBox Open Source Edition (OSE), as
9  * available from http://www.virtualbox.org. This file is free software;
10  * you can redistribute it and/or modify it under the terms of the GNU
11  * General Public License (GPL) as published by the Free Software
12  * Foundation, in version 2 as it comes in the "COPYING" file of the
13  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15  *
16  * The contents of this file may alternatively be used under the terms
17  * of the Common Development and Distribution License Version 1.0
18  * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19  * VirtualBox OSE distribution, in which case the provisions of the
20  * CDDL are applicable instead of those of the GPL.
21  *
22  * You may elect to license modified versions of this file under the
23  * terms and conditions of either the GPL or the CDDL or both.
24  *
25  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
26  * Clara, CA 95054 USA or visit http://www.sun.com if you need
27  * additional information or have any questions.
28  * --------------------------------------------------------------------
29  *
30  * This code is based on:
31  *
32  * from: @(#)fdlibm.h 5.1 93/09/24
33  * $FreeBSD: src/lib/msun/src/math.h,v 1.61 2005/04/16 21:12:47 das Exp $
34  * FreeBSD HEAD 2005-06-xx
35  *
36  * ====================================================
37  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
38  *
39  * Developed at SunPro, a Sun Microsystems, Inc. business.
40  * Permission to use, copy, modify, and distribute this
41  * software is freely granted, provided that this notice
42  * is preserved.
43  * ====================================================
44  */
45
46 #ifndef ___iprt_nocrt_math_h
47 #define ___iprt_nocrt_math_h
48
49 #if !defined(__GNUC__) /* && !defined(__YOUR_COMPILER__) */
50 # error "IPRT: Adjust this header for your compiler"
51 #endif
52
53 #include <iprt/types.h>
54 /*#include <machine/_limits.h>*/
55
56 /* from sys/cdefs.h */
57 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
58 #define __GNUC_PREREQ__(ma, mi) \
59     (__GNUC__ > (ma) || __GNUC__ == (ma) && __GNUC_MINOR__ >= (mi))
60 #else
61 #define __GNUC_PREREQ__(ma, mi) 0
62 #endif
63 #define __pure2
64
65
66 /*
67  * ANSI/POSIX
68  */
69 extern const union __infinity_un {
70     unsigned char   __uc[8];
71     double      __ud;
72 } RT_NOCRT(__infinity);
73
74 extern const union __nan_un {
75     unsigned char   __uc[sizeof(float)];
76     float       __uf;
77 } RT_NOCRT(__nan);
78
79 #if __GNUC_PREREQ__(3, 3) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800)
80 #define __MATH_BUILTIN_CONSTANTS
81 #endif
82
83 #if __GNUC_PREREQ__(3, 0) && !defined(__INTEL_COMPILER)
84 #define __MATH_BUILTIN_RELOPS
85 #endif
86
87 #ifdef __MATH_BUILTIN_CONSTANTS
88 #define HUGE_VAL    __builtin_huge_val()
89 #else
90 #define HUGE_VAL    (RT_NOCRT(__infinity).__ud)
91 #endif
92
93 #if 1/* __ISO_C_VISIBLE >= 1999*/
94 #define FP_ILOGB0   (-__INT_MAX)
95 #define FP_ILOGBNAN __INT_MAX
96
97 #ifdef __MATH_BUILTIN_CONSTANTS
98 #define HUGE_VALF   __builtin_huge_valf()
99 #define HUGE_VALL   __builtin_huge_vall()
100 #define INFINITY    __builtin_inf()
101 #define NAN     __builtin_nan("")
102 #else
103 #define HUGE_VALF   (float)HUGE_VAL
104 #define HUGE_VALL   (long double)HUGE_VAL
105 #define INFINITY    HUGE_VALF
106 #define NAN     (__nan.__uf)
107 #endif /* __MATH_BUILTIN_CONSTANTS */
108
109 #define MATH_ERRNO  1
110 #define MATH_ERREXCEPT  2
111 #define math_errhandling    MATH_ERREXCEPT
112
113 /* XXX We need a <machine/math.h>. */
114 #if defined(__ia64__) || defined(__sparc64__)
115 #define FP_FAST_FMA
116 #endif
117 #ifdef __ia64__
118 #define FP_FAST_FMAL
119 #endif
120 #define FP_FAST_FMAF
121
122 /* Symbolic constants to classify floating point numbers. */
123 #define FP_INFINITE 0x01
124 #define FP_NAN      0x02
125 #define FP_NORMAL   0x04
126 #define FP_SUBNORMAL    0x08
127 #define FP_ZERO     0x10
128 #define fpclassify(x) \
129     ((sizeof (x) == sizeof (float)) ? RT_NOCRT(__fpclassifyf)(x) \
130     : (sizeof (x) == sizeof (double)) ? RT_NOCRT(__fpclassifyd)(x) \
131     : RT_NOCRT(__fpclassifyl)(x))
132
133 #define isfinite(x)                 \
134     ((sizeof (x) == sizeof (float)) ? RT_NOCRT(__isfinitef)(x)    \
135     : (sizeof (x) == sizeof (double)) ? RT_NOCRT(__isfinite)(x)   \
136     : RT_NOCRT(__isfinitel)(x))
137 #define isinf(x)                    \
138     ((sizeof (x) == sizeof (float)) ? RT_NOCRT(__isinff)(x)   \
139     : (sizeof (x) == sizeof (double)) ? isinf(x)    \
140     : RT_NOCRT(__isinfl)(x))
141 #define isnan(x)                    \
142     ((sizeof (x) == sizeof (float)) ? isnanf(x)     \
143     : (sizeof (x) == sizeof (double)) ? isnan(x)    \
144     : RT_NOCRT(__isnanl)(x))
145 #define isnormal(x)                 \
146     ((sizeof (x) == sizeof (float)) ? RT_NOCRT(__isnormalf)(x)    \
147     : (sizeof (x) == sizeof (double)) ? RT_NOCRT(__isnormal)(x)   \
148     : RT_NOCRT(__isnormall)(x))
149
150 #ifdef __MATH_BUILTIN_RELOPS
151 #define isgreater(x, y)     __builtin_isgreater((x), (y))
152 #define isgreaterequal(x, y)    __builtin_isgreaterequal((x), (y))
153 #define isless(x, y)        __builtin_isless((x), (y))
154 #define islessequal(x, y)   __builtin_islessequal((x), (y))
155 #define islessgreater(x, y) __builtin_islessgreater((x), (y))
156 #define isunordered(x, y)   __builtin_isunordered((x), (y))
157 #else
158 #define isgreater(x, y)     (!isunordered((x), (y)) && (x) > (y))
159 #define isgreaterequal(x, y)    (!isunordered((x), (y)) && (x) >= (y))
160 #define isless(x, y)        (!isunordered((x), (y)) && (x) < (y))
161 #define islessequal(x, y)   (!isunordered((x), (y)) && (x) <= (y))
162 #define islessgreater(x, y) (!isunordered((x), (y)) && \
163                     ((x) > (y) || (y) > (x)))
164 #define isunordered(x, y)   (isnan(x) || isnan(y))
165 #endif /* __MATH_BUILTIN_RELOPS */
166
167 #define signbit(x)                  \
168     ((sizeof (x) == sizeof (float)) ? RT_NOCRT(__signbitf)(x) \
169     : (sizeof (x) == sizeof (double)) ? RT_NOCRT(__signbit)(x)    \
170     : RT_NOCRT(__signbitl)(x))
171
172 typedef double  double_t;
173 typedef float   float_t;
174 #endif /* __ISO_C_VISIBLE >= 1999 */
175
176 /*
177  * XOPEN/SVID
178  */
179 #if 1/* __BSD_VISIBLE || __XSI_VISIBLE*/
180 #define M_E     2.7182818284590452354   /* e */
181 #define M_LOG2E     1.4426950408889634074   /* log 2e */
182 #define M_LOG10E    0.43429448190325182765  /* log 10e */
183 #define M_LN2       0.69314718055994530942  /* log e2 */
184 #define M_LN10      2.30258509299404568402  /* log e10 */
185 #define M_PI        3.14159265358979323846  /* pi */
186 #define M_PI_2      1.57079632679489661923  /* pi/2 */
187 #define M_PI_4      0.78539816339744830962  /* pi/4 */
188 #define M_1_PI      0.31830988618379067154  /* 1/pi */
189 #define M_2_PI      0.63661977236758134308  /* 2/pi */
190 #define M_2_SQRTPI  1.12837916709551257390  /* 2/sqrt(pi) */
191 #define M_SQRT2     1.41421356237309504880  /* sqrt(2) */
192 #define M_SQRT1_2   0.70710678118654752440  /* 1/sqrt(2) */
193
194 #define MAXFLOAT    ((float)3.40282346638528860e+38)
195 extern int RT_NOCRT(signgam);
196 #endif /* __BSD_VISIBLE || __XSI_VISIBLE */
197
198 #if 1/* __BSD_VISIBLE*/
199 #if 0
200 /* Old value from 4.4BSD-Lite math.h; this is probably better. */
201 #define HUGE        HUGE_VAL
202 #else
203 #define HUGE        MAXFLOAT
204 #endif
205 #endif /* __BSD_VISIBLE */
206
207 /*
208  * Most of these functions depend on the rounding mode and have the side
209  * effect of raising floating-point exceptions, so they are not declared
210  * as __pure2.  In C99, FENV_ACCESS affects the purity of these functions.
211  */
212 __BEGIN_DECLS
213 /*
214  * ANSI/POSIX
215  */
216 int RT_NOCRT(__fpclassifyd)(double) __pure2;
217 int RT_NOCRT(__fpclassifyf)(float) __pure2;
218 int RT_NOCRT(__fpclassifyl)(long double) __pure2;
219 int RT_NOCRT(__isfinitef)(float) __pure2;
220 int RT_NOCRT(__isfinite)(double) __pure2;
221 int RT_NOCRT(__isfinitel)(long double) __pure2;
222 int RT_NOCRT(__isinff)(float) __pure2;
223 int RT_NOCRT(__isinfl)(long double) __pure2;
224 int RT_NOCRT(__isnanl)(long double) __pure2;
225 int RT_NOCRT(__isnormalf)(float) __pure2;
226 int RT_NOCRT(__isnormal)(double) __pure2;
227 int RT_NOCRT(__isnormall)(long double) __pure2;
228 int RT_NOCRT(__signbit)(double) __pure2;
229 int RT_NOCRT(__signbitf)(float) __pure2;
230 int RT_NOCRT(__signbitl)(long double) __pure2;
231
232 double  RT_NOCRT(acos)(double);
233 double  RT_NOCRT(asin)(double);
234 double  RT_NOCRT(atan)(double);
235 double  RT_NOCRT(atan2)(double, double);
236 double  RT_NOCRT(cos)(double);
237 double  RT_NOCRT(sin)(double);
238 double  RT_NOCRT(tan)(double);
239
240 double  RT_NOCRT(cosh)(double);
241 double  RT_NOCRT(sinh)(double);
242 double  RT_NOCRT(tanh)(double);
243
244 double  RT_NOCRT(exp)(double);
245 double  RT_NOCRT(frexp)(double, int *);   /* fundamentally !__pure2 */
246 double  RT_NOCRT(ldexp)(double, int);
247 double  RT_NOCRT(log)(double);
248 double  RT_NOCRT(log10)(double);
249 double  RT_NOCRT(modf)(double, double *); /* fundamentally !__pure2 */
250
251 double  RT_NOCRT(pow)(double, double);
252 double  RT_NOCRT(sqrt)(double);
253
254 double  RT_NOCRT(ceil)(double);
255 double  RT_NOCRT(fabs)(double) __pure2;
256 double  RT_NOCRT(floor)(double);
257 double  RT_NOCRT(fmod)(double, double);
258
259 /*
260  * These functions are not in C90.
261  */
262 #if 1 /*__BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE*/
263 double  RT_NOCRT(acosh)(double);
264 double  RT_NOCRT(asinh)(double);
265 double  RT_NOCRT(atanh)(double);
266 double  RT_NOCRT(cbrt)(double);
267 double  RT_NOCRT(erf)(double);
268 double  RT_NOCRT(erfc)(double);
269 double  RT_NOCRT(exp2)(double);
270 double  RT_NOCRT(expm1)(double);
271 double  RT_NOCRT(fma)(double, double, double);
272 double  RT_NOCRT(hypot)(double, double);
273 int RT_NOCRT(ilogb)(double) __pure2;
274 /*int isinf(double) __pure2;*/
275 /*int isnan(double) __pure2;*/
276 double  RT_NOCRT(lgamma)(double);
277 long long RT_NOCRT(llrint)(double);
278 long long RT_NOCRT(llround)(double);
279 double  RT_NOCRT(log1p)(double);
280 double  RT_NOCRT(logb)(double);
281 long    RT_NOCRT(lrint)(double);
282 long    RT_NOCRT(lround)(double);
283 double  RT_NOCRT(nextafter)(double, double);
284 double  RT_NOCRT(remainder)(double, double);
285 double  RT_NOCRT(remquo)(double, double, int *);
286 double  RT_NOCRT(rint)(double);
287 #endif /* __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE */
288
289 #if 1/* __BSD_VISIBLE || __XSI_VISIBLE*/
290 double  RT_NOCRT(j0)(double);
291 double  RT_NOCRT(j1)(double);
292 double  RT_NOCRT(jn)(int, double);
293 double  RT_NOCRT(scalb)(double, double);
294 double  RT_NOCRT(y0)(double);
295 double  RT_NOCRT(y1)(double);
296 double  RT_NOCRT(yn)(int, double);
297
298 #if 1/* __XSI_VISIBLE <= 500 || __BSD_VISIBLE*/
299 double  RT_NOCRT(gamma)(double);
300 #endif
301 #endif /* __BSD_VISIBLE || __XSI_VISIBLE */
302
303 #if 1/* __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999*/
304 double  RT_NOCRT(copysign)(double, double) __pure2;
305 double  RT_NOCRT(fdim)(double, double);
306 double  RT_NOCRT(fmax)(double, double) __pure2;
307 double  RT_NOCRT(fmin)(double, double) __pure2;
308 double  RT_NOCRT(nearbyint)(double);
309 double  RT_NOCRT(round)(double);
310 double  RT_NOCRT(scalbln)(double, long);
311 double  RT_NOCRT(scalbn)(double, int);
312 double  RT_NOCRT(tgamma)(double);
313 double  RT_NOCRT(trunc)(double);
314 #endif
315
316 /*
317  * BSD math library entry points
318  */
319 #if 1/* __BSD_VISIBLE*/
320 double  RT_NOCRT(drem)(double, double);
321 int RT_NOCRT(finite)(double) __pure2;
322 int RT_NOCRT(isnanf)(float) __pure2;
323
324 /*
325  * Reentrant version of gamma & lgamma; passes signgam back by reference
326  * as the second argument; user must allocate space for signgam.
327  */
328 double  RT_NOCRT(gamma_r)(double, int *);
329 double  RT_NOCRT(lgamma_r)(double, int *);
330
331 /*
332  * IEEE Test Vector
333  */
334 double  RT_NOCRT(significand)(double);
335 #endif /* __BSD_VISIBLE */
336
337 /* float versions of ANSI/POSIX functions */
338 #if 1/* __ISO_C_VISIBLE >= 1999*/
339 float   RT_NOCRT(acosf)(float);
340 float   RT_NOCRT(asinf)(float);
341 float   RT_NOCRT(atanf)(float);
342 float   RT_NOCRT(atan2f)(float, float);
343 float   RT_NOCRT(cosf)(float);
344 float   RT_NOCRT(sinf)(float);
345 float   RT_NOCRT(tanf)(float);
346
347 float   RT_NOCRT(coshf)(float);
348 float   RT_NOCRT(sinhf)(float);
349 float   RT_NOCRT(tanhf)(float);
350
351 float   RT_NOCRT(exp2f)(float);
352 float   RT_NOCRT(expf)(float);
353 float   RT_NOCRT(expm1f)(float);
354 float   RT_NOCRT(frexpf)(float, int *);   /* fundamentally !__pure2 */
355 int RT_NOCRT(ilogbf)(float) __pure2;
356 float   RT_NOCRT(ldexpf)(float, int);
357 float   RT_NOCRT(log10f)(float);
358 float   RT_NOCRT(log1pf)(float);
359 float   RT_NOCRT(logf)(float);
360 float   RT_NOCRT(modff)(float, float *);  /* fundamentally !__pure2 */
361
362 float   RT_NOCRT(powf)(float, float);
363 float   RT_NOCRT(sqrtf)(float);
364
365 float   RT_NOCRT(ceilf)(float);
366 float   RT_NOCRT(fabsf)(float) __pure2;
367 float   RT_NOCRT(floorf)(float);
368 float   RT_NOCRT(fmodf)(float, float);
369 float   RT_NOCRT(roundf)(float);
370
371 float   RT_NOCRT(erff)(float);
372 float   RT_NOCRT(erfcf)(float);
373 float   RT_NOCRT(hypotf)(float, float);
374 float   RT_NOCRT(lgammaf)(float);
375
376 float   RT_NOCRT(acoshf)(float);
377 float   RT_NOCRT(asinhf)(float);
378 float   RT_NOCRT(atanhf)(float);
379 float   RT_NOCRT(cbrtf)(float);
380 float   RT_NOCRT(logbf)(float);
381 float   RT_NOCRT(copysignf)(float, float) __pure2;
382 long long RT_NOCRT(llrintf)(float);
383 long long RT_NOCRT(llroundf)(float);
384 long    RT_NOCRT(lrintf)(float);
385 long    RT_NOCRT(lroundf)(float);
386 float   RT_NOCRT(nearbyintf)(float);
387 float   RT_NOCRT(nextafterf)(float, float);
388 float   RT_NOCRT(remainderf)(float, float);
389 float   RT_NOCRT(remquof)(float, float, int *);
390 float   RT_NOCRT(rintf)(float);
391 float   RT_NOCRT(scalblnf)(float, long);
392 float   RT_NOCRT(scalbnf)(float, int);
393 float   RT_NOCRT(truncf)(float);
394
395 float   RT_NOCRT(fdimf)(float, float);
396 float   RT_NOCRT(fmaf)(float, float, float);
397 float   RT_NOCRT(fmaxf)(float, float) __pure2;
398 float   RT_NOCRT(fminf)(float, float) __pure2;
399 #endif
400
401 /*
402  * float versions of BSD math library entry points
403  */
404 #if 1/* __BSD_VISIBLE*/
405 float   RT_NOCRT(dremf)(float, float);
406 int RT_NOCRT(finitef)(float) __pure2;
407 float   RT_NOCRT(gammaf)(float);
408 float   RT_NOCRT(j0f)(float);
409 float   RT_NOCRT(j1f)(float);
410 float   RT_NOCRT(jnf)(int, float);
411 float   RT_NOCRT(scalbf)(float, float);
412 float   RT_NOCRT(y0f)(float);
413 float   RT_NOCRT(y1f)(float);
414 float   RT_NOCRT(ynf)(int, float);
415
416 /*
417  * Float versions of reentrant version of gamma & lgamma; passes
418  * signgam back by reference as the second argument; user must
419  * allocate space for signgam.
420  */
421 float   RT_NOCRT(gammaf_r)(float, int *);
422 float   RT_NOCRT(lgammaf_r)(float, int *);
423
424 /*
425  * float version of IEEE Test Vector
426  */
427 float   RT_NOCRT(significandf)(float);
428 #endif  /* __BSD_VISIBLE */
429
430 /*
431  * long double versions of ISO/POSIX math functions
432  */
433 #if 1/* __ISO_C_VISIBLE >= 1999*/
434 #if/* bird: we've got these */
435 long double RT_NOCRT(acoshl)(long double);
436 long double RT_NOCRT(acosl)(long double);
437 long double RT_NOCRT(asinhl)(long double);
438 long double RT_NOCRT(asinl)(long double);
439 long double RT_NOCRT(atan2l)(long double, long double);
440 long double RT_NOCRT(atanhl)(long double);
441 long double RT_NOCRT(atanl)(long double);
442 long double RT_NOCRT(cbrtl)(long double);
443 #endif
444 long double RT_NOCRT(ceill)(long double);
445 long double RT_NOCRT(copysignl)(long double, long double) __pure2;
446 #if 1 /* bird */
447 long double RT_NOCRT(coshl)(long double);
448 long double RT_NOCRT(cosl)(long double);
449 long double RT_NOCRT(erfcl)(long double);
450 long double RT_NOCRT(erfl)(long double);
451 long double RT_NOCRT(exp2l)(long double);
452 long double RT_NOCRT(expl)(long double);
453 long double RT_NOCRT(expm1l)(long double);
454 #endif
455 long double RT_NOCRT(fabsl)(long double) __pure2;
456 long double RT_NOCRT(fdiml)(long double, long double);
457 long double RT_NOCRT(floorl)(long double);
458 long double RT_NOCRT(fmal)(long double, long double, long double);
459 long double RT_NOCRT(fmaxl)(long double, long double) __pure2;
460 long double RT_NOCRT(fminl)(long double, long double) __pure2;
461 #if 1 /* bird */
462 long double RT_NOCRT(fmodl)(long double, long double);
463 #endif
464 long double RT_NOCRT(frexpl)(long double value, int *); /* fundamentally !__pure2 */
465 #if 1 /* bird */
466 long double RT_NOCRT(hypotl)(long double, long double);
467 #endif
468 int     RT_NOCRT(ilogbl)(long double) __pure2;
469 long double RT_NOCRT(ldexpl)(long double, int);
470 #if 1 /* bird */
471 long double RT_NOCRT(lgammal)(long double);
472 long long   RT_NOCRT(llrintl)(long double);
473 #endif
474 long long   RT_NOCRT(llroundl)(long double);
475 #if 1 /* bird */
476 long double RT_NOCRT(log10l)(long double);
477 long double RT_NOCRT(log1pl)(long double);
478 long double RT_NOCRT(log2l)(long double);
479 long double RT_NOCRT(logbl)(long double);
480 long double RT_NOCRT(logl)(long double);
481 long        RT_NOCRT(lrintl)(long double);
482 #endif
483 long        RT_NOCRT(lroundl)(long double);
484 #if 1 /* bird */
485 long double RT_NOCRT(modfl)(long double, long double *); /* fundamentally !__pure2 */
486 long double RT_NOCRT(nanl)(const char *) __pure2;
487 long double RT_NOCRT(nearbyintl)(long double);
488 #endif
489 long double RT_NOCRT(nextafterl)(long double, long double);
490 double      RT_NOCRT(nexttoward)(double, long double);
491 float       RT_NOCRT(nexttowardf)(float, long double);
492 long double RT_NOCRT(nexttowardl)(long double, long double);
493 #if 1 /* bird */
494 long double RT_NOCRT(powl)(long double, long double);
495 long double RT_NOCRT(remainderl)(long double, long double);
496 long double RT_NOCRT(remquol)(long double, long double, int *);
497 long double RT_NOCRT(rintl)(long double);
498 #endif
499 long double RT_NOCRT(roundl)(long double);
500 long double RT_NOCRT(scalblnl)(long double, long);
501 long double RT_NOCRT(scalbnl)(long double, int);
502 #if 1 /* bird: we 've got most of these. */
503 long double RT_NOCRT(sinhl)(long double);
504 long double RT_NOCRT(sinl)(long double);
505 long double RT_NOCRT(sqrtl)(long double);
506 long double RT_NOCRT(tanhl)(long double);
507 long double RT_NOCRT(tanl)(long double);
508 long double RT_NOCRT(tgammal)(long double);
509 #endif
510 long double RT_NOCRT(truncl)(long double);
511
512 /* bird: these were missing, gcc apparently inlines them. */
513 double          RT_NOCRT(nan)(const char *);
514 float           RT_NOCRT(nanf)(const char *);
515
516 #endif /* __ISO_C_VISIBLE >= 1999 */
517
518 #if 1/*def __USE_GNU*/
519 /*
520  * In GLIBC there are long variants of the XOPEN/SVID constant
521  * block some pages ago. We need this to get the math tests going.
522  */
523 #define M_El                2.7182818284590452353602874713526625L
524 #define M_LOG2El            1.4426950408889634073599246810018921L
525 #define M_LOG10El           0.4342944819032518276511289189166051L
526 #define M_LN2l              0.6931471805599453094172321214581766L
527 #define M_LN10l             2.3025850929940456840179914546843642L
528 #define M_PIl               3.1415926535897932384626433832795029L
529 #define M_PI_2l             1.5707963267948966192313216916397514L
530 #define M_PI_4l             0.7853981633974483096156608458198757L
531 #define M_1_PIl             0.3183098861837906715377675267450287L
532 #define M_2_PIl             0.6366197723675813430755350534900574L
533 #define M_2_SQRTPIl         1.1283791670955125738961589031215452L
534 #define M_SQRT2l            1.4142135623730950488016887242096981L
535 #define M_SQRT1_2l          0.7071067811865475244008443621048490L
536 #endif
537
538 #if 1/*def __USE_GNU*/
539
540 void RT_NOCRT(sincos)(double, double *, double *);
541 void RT_NOCRT(sincosf)(float, float *, float *);
542 void RT_NOCRT(sincosl)(long double, long double *, long double *);
543 float RT_NOCRT(exp10f)(float);
544 double RT_NOCRT(exp10)(double);
545 long double RT_NOCRT(exp10l)(long double);
546 float RT_NOCRT(log2f)(float);
547 double RT_NOCRT(log2)(double);
548 long double RT_NOCRT(log2l)(long double);
549 float RT_NOCRT(tgammaf)(float);
550 long double RT_NOCRT(significandl)(long double);
551 long double RT_NOCRT(j0l)(long double);
552 long double RT_NOCRT(j1l)(long double);
553 long double RT_NOCRT(jnl)(int, long double);
554 long double RT_NOCRT(scalbl)(long double, long double);
555 long double RT_NOCRT(y0l)(long double);
556 long double RT_NOCRT(y1l)(long double);
557 long double RT_NOCRT(ynl)(int, long double);
558 long double RT_NOCRT(lgammal_r)(long double,int *);
559 long double RT_NOCRT(gammal)(long double);
560 #endif
561 __END_DECLS
562
563
564
565 #if !defined(RT_WITHOUT_NOCRT_WRAPPERS) && !defined(RT_WITHOUT_NOCRT_WRAPPER_ALIASES)
566 /* sed -e "/#/d" -e "/RT_NOCRT/!d" -e "s/^.*RT_NOCRT(\([a-z0-9_]*\)).*$/# define \1 RT_NOCRT(\1)/" */
567 # define __infinity RT_NOCRT(__infinity)
568 # define __nan RT_NOCRT(__nan)
569 # define __fpclassifyf RT_NOCRT(__fpclassifyf)
570 # define __fpclassifyd RT_NOCRT(__fpclassifyd)
571 # define __fpclassifyl RT_NOCRT(__fpclassifyl)
572 # define __isfinitef RT_NOCRT(__isfinitef)
573 # define __isfinite RT_NOCRT(__isfinite)
574 # define __isfinitel RT_NOCRT(__isfinitel)
575 # define __isinff RT_NOCRT(__isinff)
576 # define __isinfl RT_NOCRT(__isinfl)
577 # define __isnanl RT_NOCRT(__isnanl)
578 # define __isnormalf RT_NOCRT(__isnormalf)
579 # define __isnormal RT_NOCRT(__isnormal)
580 # define __isnormall RT_NOCRT(__isnormall)
581 # define __signbitf RT_NOCRT(__signbitf)
582 # define __signbit RT_NOCRT(__signbit)
583 # define __signbitl RT_NOCRT(__signbitl)
584 # define signgam RT_NOCRT(signgam)
585 # define __fpclassifyd RT_NOCRT(__fpclassifyd)
586 # define __fpclassifyf RT_NOCRT(__fpclassifyf)
587 # define __fpclassifyl RT_NOCRT(__fpclassifyl)
588 # define __isfinitef RT_NOCRT(__isfinitef)
589 # define __isfinite RT_NOCRT(__isfinite)
590 # define __isfinitel RT_NOCRT(__isfinitel)
591 # define __isinff RT_NOCRT(__isinff)
592 # define __isinfl RT_NOCRT(__isinfl)
593 # define __isnanl RT_NOCRT(__isnanl)
594 # define __isnormalf RT_NOCRT(__isnormalf)
595 # define __isnormal RT_NOCRT(__isnormal)
596 # define __isnormall RT_NOCRT(__isnormall)
597 # define __signbit RT_NOCRT(__signbit)
598 # define __signbitf RT_NOCRT(__signbitf)
599 # define __signbitl RT_NOCRT(__signbitl)
600 # define acos RT_NOCRT(acos)
601 # define asin RT_NOCRT(asin)
602 # define atan RT_NOCRT(atan)
603 # define atan2 RT_NOCRT(atan2)
604 # define cos RT_NOCRT(cos)
605 # define sin RT_NOCRT(sin)
606 # define tan RT_NOCRT(tan)
607 # define cosh RT_NOCRT(cosh)
608 # define sinh RT_NOCRT(sinh)
609 # define tanh RT_NOCRT(tanh)
610 # define exp RT_NOCRT(exp)
611 # define frexp RT_NOCRT(frexp)
612 # define ldexp RT_NOCRT(ldexp)
613 # define log RT_NOCRT(log)
614 # define log10 RT_NOCRT(log10)
615 # define modf RT_NOCRT(modf)
616 # define pow RT_NOCRT(pow)
617 # define sqrt RT_NOCRT(sqrt)
618 # define ceil RT_NOCRT(ceil)
619 # define fabs RT_NOCRT(fabs)
620 # define floor RT_NOCRT(floor)
621 # define fmod RT_NOCRT(fmod)
622 # define acosh RT_NOCRT(acosh)
623 # define asinh RT_NOCRT(asinh)
624 # define atanh RT_NOCRT(atanh)
625 # define cbrt RT_NOCRT(cbrt)
626 # define erf RT_NOCRT(erf)
627 # define erfc RT_NOCRT(erfc)
628 # define exp2 RT_NOCRT(exp2)
629 # define expm1 RT_NOCRT(expm1)
630 # define fma RT_NOCRT(fma)
631 # define hypot RT_NOCRT(hypot)
632 # define ilogb RT_NOCRT(ilogb)
633 # define lgamma RT_NOCRT(lgamma)
634 # define llrint RT_NOCRT(llrint)
635 # define llround RT_NOCRT(llround)
636 # define log1p RT_NOCRT(log1p)
637 # define logb RT_NOCRT(logb)
638 # define lrint RT_NOCRT(lrint)
639 # define lround RT_NOCRT(lround)
640 # define nextafter RT_NOCRT(nextafter)
641 # define remainder RT_NOCRT(remainder)
642 # define remquo RT_NOCRT(remquo)
643 # define rint RT_NOCRT(rint)
644 # define j0 RT_NOCRT(j0)
645 # define j1 RT_NOCRT(j1)
646 # define jn RT_NOCRT(jn)
647 # define scalb RT_NOCRT(scal