1 /* vi: set sw=4 ts=4: */
3 * Wrapper functions implementing all the long double math functions
4 * defined by SuSv3 by actually calling the double version of
5 * each function and then casting the result back to a long double
6 * to return to the user.
8 * Copyright (C) 2005 by Erik Andersen <andersen@uclibc.org>
10 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
14 /* Prevent math.h from defining colliding inlines */
15 #undef __USE_EXTERN_INLINES
19 #define WRAPPER1(func) \
20 long double func##l(long double x) \
22 return (long double) func((double) x); \
24 #define WRAPPER2(func) \
25 long double func##l(long double x, long double y) \
27 return (long double) func((double) x, (double) y); \
29 #define int_WRAPPER1(func) \
30 int func##l(long double x) \
32 return func((double) x); \
34 #define long_WRAPPER1(func) \
35 long func##l(long double x) \
37 return func((double) x); \
39 #define long_long_WRAPPER1(func) \
40 long long func##l(long double x) \
42 return func((double) x); \
45 /* Implement the following, as defined by SuSv3 */
47 long double acoshl(long double);
48 long double acosl(long double);
49 long double asinhl(long double);
50 long double asinl(long double);
51 long double atan2l(long double, long double);
52 long double atanhl(long double);
53 long double atanl(long double);
54 long double cargl(long double complex);
55 long double cbrtl(long double);
56 long double ceill(long double);
57 long double copysignl(long double, long double);
58 long double coshl(long double);
59 long double cosl(long double);
60 long double erfcl(long double);
61 long double erfl(long double);
62 long double exp2l(long double);
63 long double expl(long double);
64 long double expm1l(long double);
65 long double fabsl(long double);
66 long double fdiml(long double, long double);
67 long double floorl(long double);
68 long double fmal(long double, long double, long double);
69 long double fmaxl(long double, long double);
70 long double fminl(long double, long double);
71 long double fmodl(long double, long double);
72 long double frexpl(long double value
, int *);
73 long double hypotl(long double, long double);
74 int ilogbl(long double);
75 long double ldexpl(long double, int);
76 long double lgammal(long double);
77 long long llrintl(long double);
78 long long llroundl(long double);
79 long double log10l(long double);
80 long double log1pl(long double);
81 long double log2l(long double);
82 long double logbl(long double);
83 long double logl(long double);
84 long lrintl(long double);
85 long lroundl(long double);
86 long double modfl(long double, long double *);
87 long double nearbyintl(long double);
88 long double nextafterl(long double, long double);
89 long double nexttowardl(long double, long double);
90 long double powl(long double, long double);
91 long double remainderl(long double, long double);
92 long double remquol(long double, long double, int *);
93 long double rintl(long double);
94 long double roundl(long double);
95 long double scalblnl(long double, long);
96 long double scalbnl(long double, int);
97 long double sinhl(long double);
98 long double sinl(long double);
99 long double sqrtl(long double);
100 long double tanhl(long double);
101 long double tanl(long double);
102 long double tgammal(long double);
103 long double truncl(long double);
135 long double cargl (long double complex x
)
137 return (long double) carg( (double complex)x
);
194 long double fmal (long double x
, long double y
, long double z
)
196 return (long double) fma( (double)x
, (double)y
, (double)z
);
213 long double frexpl (long double x
, int *ex
)
215 return (long double) frexp( (double)x
, ex
);
232 long double ldexpl (long double x
, int ex
)
234 return (long double) ldexp( (double)x
, ex
);
243 long_long_WRAPPER1(llrint
)
247 long_long_WRAPPER1(llround
)
275 long_WRAPPER1(lround
)
279 long double modfl (long double x
, long double *iptr
)
282 result
= modf ( x
, &y
);
283 *iptr
= (long double)y
;
284 return (long double) result
;
296 /* Disabled in Makefile.in */
297 #if 0 /* def L_nexttowardl */
299 libm_hidden_def(nexttowardl
)
311 long double remquol (long double x
, long double y
, int *quo
)
313 return (long double) remquo( (double)x
, (double)y
, quo
);
326 long double scalblnl (long double x
, long ex
)
328 return (long double) scalbln( (double)x
, ex
);
333 long double scalbnl (long double x
, int ex
)
335 return (long double) scalbn( (double)x
, ex
);
339 /* scalb is an obsolete function */
369 #ifdef L_significandl
370 WRAPPER1(significand
)
373 #if defined __DO_C99_MATH__ && !defined __NO_LONG_DOUBLE_MATH
375 # ifdef L___fpclassifyl
376 int_WRAPPER1(__fpclassify
)
377 libm_hidden_def(__fpclassifyl
)
381 int_WRAPPER1(__finite
)
382 libm_hidden_def(__finitel
)
386 int_WRAPPER1(__signbit
)
387 libm_hidden_def(__signbitl
)
391 int_WRAPPER1(__isnan
)
392 libm_hidden_def(__isnanl
)
396 int_WRAPPER1(__isinf
)
397 libm_hidden_def(__isinfl
)