2 * Wrapper functions implementing all the float math functions
3 * defined by SuSv3 by actually calling the double version of
4 * each function and then casting the result back to a float
5 * to return to the user.
7 * Copyright (C) 2005 by Erik Andersen <andersen@uclibc.org>
9 * GNU Lesser General Public License version 2.1 or later.
13 /* Prevent math.h from defining colliding inlines */
14 #undef __USE_EXTERN_INLINES
19 #define WRAPPER1(func) \
20 float func##f (float x) \
22 return (float) func((double)x); \
24 #define int_WRAPPER1(func) \
25 int func##f (float x) \
27 return func((double)x); \
29 #define long_WRAPPER1(func) \
30 long func##f (float x) \
32 return func((double)x); \
34 #define long_long_WRAPPER1(func) \
35 long long func##f (float x) \
37 return func((double)x); \
40 /* Implement the following, as defined by SuSv3 */
44 float cargf(float complex);
47 float copysignf(float, float);
54 float frexpf(float value
, int *);
56 float ldexpf(float, int);
57 long long llroundf(float);
61 float modff(float, float *);
64 float scalbnf(float, int);
70 /* The following functions implemented as wrappers
71 * in separate files (w_funcf.c)
77 float atan2f(float, float);
82 float fmodf(float, float);
83 float hypotf(float, float);
88 float powf(float, float);
89 float remainderf(float, float);
94 float jnf(int n
, float x
);
97 float ynf(int n
, float x
);
98 float tgammaf(float x
);
99 float scalbf(float x
, float fn
);
100 float gammaf(float x
);
101 float scalbl(float x
, float fn
);
113 float cargf (float complex x
)
115 return (float) carg( (double complex)x
);
128 float copysignf (float x
, float y
)
130 return (float) copysign( (double)x
, (double)y
);
136 libm_hidden_def(cosf
)
156 float fdimf (float x
, float y
)
158 return (float) fdim( (double)x
, (double)y
);
167 float fmaf (float x
, float y
, float z
)
169 return (float) fma( (double)x
, (double)y
, (double)z
);
174 float fmaxf (float x
, float y
)
176 return (float) fmax( (double)x
, (double)y
);
181 float fminf (float x
, float y
)
183 return (float) fmin( (double)x
, (double)y
);
188 float frexpf (float x
, int *_exp
)
190 return (float) frexp( (double)x
, _exp
);
199 float ldexpf (float x
, int _exp
)
201 return (float) ldexp( (double)x
, _exp
);
206 long_long_WRAPPER1(llrint
)
210 long_long_WRAPPER1(llround
)
226 long_WRAPPER1(lround
)
230 float modff (float x
, float *iptr
)
233 result
= modf( x
, &y
);
235 return (float) result
;
244 float nexttowardf (float x
, long double y
)
246 return (float) nexttoward( (double)x
, (long double)y
);
251 float remquof (float x
, float y
, int *quo
)
253 return (float) remquo( (double)x
, (double)y
, quo
);
266 float scalblnf (float x
, long _exp
)
268 return (float) scalbln( (double)x
, _exp
);
273 float scalbnf (float x
, int _exp
)
275 return (float) scalbn( (double)x
, _exp
);
281 libm_hidden_def(sinf
)
296 #ifdef L_significandf
297 WRAPPER1(significand
)