123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526 |
- /* vi: set sw=4 ts=4: */
- /*
- * Wrapper functions implementing all the long double math functions
- * defined by SuSv3 by actually calling the double version of
- * each function and then casting the result back to a long double
- * to return to the user.
- *
- * Copyright (C) 2005 by Erik Andersen <andersen@uclibc.org>
- *
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
- #include <features.h>
- /* Prevent math.h from defining colliding inlines */
- #undef __USE_EXTERN_INLINES
- #include "math.h"
- /* Implement the following, as defined by SuSv3 */
- #if 0
- long double acoshl(long double);
- long double acosl(long double);
- long double asinhl(long double);
- long double asinl(long double);
- long double atan2l(long double, long double);
- long double atanhl(long double);
- long double atanl(long double);
- long double cbrtl(long double);
- long double ceill(long double);
- long double copysignl(long double, long double);
- long double coshl(long double);
- long double cosl(long double);
- long double erfcl(long double);
- long double erfl(long double);
- long double exp2l(long double);
- long double expl(long double);
- long double expm1l(long double);
- long double fabsl(long double);
- long double fdiml(long double, long double);
- long double floorl(long double);
- long double fmal(long double, long double, long double);
- long double fmaxl(long double, long double);
- long double fminl(long double, long double);
- long double fmodl(long double, long double);
- long double frexpl(long double value, int *);
- long double hypotl(long double, long double);
- int ilogbl(long double);
- long double ldexpl(long double, int);
- long double lgammal(long double);
- long long llrintl(long double);
- long long llroundl(long double);
- long double log10l(long double);
- long double log1pl(long double);
- long double log2l(long double);
- long double logbl(long double);
- long double logl(long double);
- long lrintl(long double);
- long lroundl(long double);
- long double modfl(long double, long double *);
- long double nearbyintl(long double);
- long double nextafterl(long double, long double);
- long double nexttowardl(long double, long double);
- long double powl(long double, long double);
- long double remainderl(long double, long double);
- long double remquol(long double, long double, int *);
- long double rintl(long double);
- long double roundl(long double);
- long double scalblnl(long double, long);
- long double scalbnl(long double, int);
- long double sinhl(long double);
- long double sinl(long double);
- long double sqrtl(long double);
- long double tanhl(long double);
- long double tanl(long double);
- long double tgammal(long double);
- long double truncl(long double);
- #endif
- #ifdef L_acoshl
- long double acoshl (long double x)
- {
- return (long double) acosh( (double)x );
- }
- #endif
- #ifdef L_acosl
- long double acosl (long double x)
- {
- return (long double) acos( (double)x );
- }
- #endif
- #ifdef L_asinhl
- long double asinhl (long double x)
- {
- return (long double) asinh( (double)x );
- }
- #endif
- #ifdef L_asinl
- long double asinl (long double x)
- {
- return (long double) asin( (double)x );
- }
- #endif
- #ifdef L_atan2l
- long double atan2l (long double x, long double y)
- {
- return (long double) atan2( (double)x, (double)y );
- }
- #endif
- #ifdef L_atanhl
- long double atanhl (long double x)
- {
- return (long double) atanh( (double)x );
- }
- #endif
- #ifdef L_atanl
- long double atanl (long double x)
- {
- return (long double) atan( (double)x );
- }
- #endif
- #ifdef L_cbrtl
- long double cbrtl (long double x)
- {
- return (long double) cbrt( (double)x );
- }
- #endif
- #ifdef L_ceill
- long double ceill (long double x)
- {
- return (long double) ceil( (double)x );
- }
- #endif
- #ifdef L_copysignl
- long double copysignl (long double x, long double y)
- {
- return (long double) copysign( (double)x, (double)y );
- }
- #endif
- #ifdef L_coshl
- long double coshl (long double x)
- {
- return (long double) cosh( (double)x );
- }
- #endif
- #ifdef L_cosl
- long double cosl (long double x)
- {
- return (long double) cos( (double)x );
- }
- #endif
- #ifdef L_erfcl
- long double erfcl (long double x)
- {
- return (long double) erfc( (double)x );
- }
- #endif
- #ifdef L_erfl
- long double erfl (long double x)
- {
- return (long double) erf( (double)x );
- }
- #endif
- #ifdef L_exp2l
- long double exp2l (long double x)
- {
- return (long double) exp2( (double)x );
- }
- #endif
- #ifdef L_expl
- long double expl (long double x)
- {
- return (long double) exp( (double)x );
- }
- #endif
- #ifdef L_expm1l
- long double expm1l (long double x)
- {
- return (long double) expm1( (double)x );
- }
- #endif
- #ifdef L_fabsl
- long double fabsl (long double x)
- {
- return (long double) fabs( (double)x );
- }
- #endif
- #ifdef L_fdiml
- long double fdiml (long double x, long double y)
- {
- return (long double) fdim( (double)x, (double)y );
- }
- #endif
- #ifdef L_floorl
- long double floorl (long double x)
- {
- return (long double) floor( (double)x );
- }
- #endif
- #ifdef L_fmal
- long double fmal (long double x, long double y, long double z)
- {
- return (long double) fma( (double)x, (double)y, (double)z );
- }
- #endif
- #ifdef L_fmaxl
- long double fmaxl (long double x, long double y)
- {
- return (long double) fmax( (double)x, (double)y );
- }
- #endif
- #ifdef L_fminl
- long double fminl (long double x, long double y)
- {
- return (long double) fmin( (double)x, (double)y );
- }
- #endif
- #ifdef L_fmodl
- long double fmodl (long double x, long double y)
- {
- return (long double) fmod( (double)x, (double)y );
- }
- #endif
- #ifdef L_frexpl
- long double frexpl (long double x, int *exp)
- {
- return (long double) frexp( (double)x, exp );
- }
- #endif
- #ifdef L_hypotl
- long double hypotl (long double x, long double y)
- {
- return (long double) hypot( (double)x, (double)y );
- }
- #endif
- #ifdef L_ilogbl
- int ilogbl (long double x)
- {
- return (long double) ilogb( (double)x );
- }
- #endif
- #ifdef L_ldexpl
- long double ldexpl (long double x, int exp)
- {
- return (long double) ldexp( (double)x, exp );
- }
- #endif
- #ifdef L_lgammal
- long double lgammal (long double x)
- {
- return (long double) lgamma( (double)x );
- }
- #endif
- #ifdef L_llrintl
- long long llrintl (long double x)
- {
- return (long double) llrint( (double)x );
- }
- #endif
- #ifdef L_llroundl
- long long llroundl (long double x)
- {
- return (long double) llround( (double)x );
- }
- #endif
- #ifdef L_log10l
- long double log10l (long double x)
- {
- return (long double) log10( (double)x );
- }
- #endif
- #ifdef L_log1pl
- long double log1pl (long double x)
- {
- return (long double) log1p( (double)x );
- }
- #endif
- #ifdef L_log2l
- long double log2l (long double x)
- {
- return (long double) log2( (double)x );
- }
- #endif
- #ifdef L_logbl
- long double logbl (long double x)
- {
- return (long double) logb( (double)x );
- }
- #endif
- #ifdef L_logl
- long double logl (long double x)
- {
- return (long double) log( (double)x );
- }
- #endif
- #ifdef L_lrintl
- long lrintl (long double x)
- {
- return (long double) lrint( (double)x );
- }
- #endif
- #ifdef L_lroundl
- long lroundl (long double x)
- {
- return (long double) lround( (double)x );
- }
- #endif
- #ifdef L_modfl
- long double modfl (long double x, long double *iptr)
- {
- double y, result;
- result = modf ( x, &y );
- *iptr = (long double)y;
- return (long double) result;
- }
- #endif
- #ifdef L_nearbyintl
- long double nearbyintl (long double x)
- {
- return (long double) nearbyint( (double)x );
- }
- #endif
- #ifdef L_nextafterl
- long double nextafterl (long double x, long double y)
- {
- return (long double) nextafter( (double)x, (double)y );
- }
- #endif
- #ifdef L_nexttowardl
- long double nexttowardl (long double x, long double y)
- {
- return (long double) nexttoward( (double)x, (double)y );
- }
- #endif
- #ifdef L_powl
- long double powl (long double x, long double y)
- {
- return (long double) pow( (double)x, (double)y );
- }
- #endif
- #ifdef L_remainderl
- long double remainderl (long double x, long double y)
- {
- return (long double) remainder( (double)x, (double)y );
- }
- #endif
- #ifdef L_remquol
- long double remquol (long double x, long double y, int *quo)
- {
- return (long double) remquo( (double)x, (double)y, quo );
- }
- #endif
- #ifdef L_rintl
- long double rintl (long double x)
- {
- return (long double) rint( (double)x );
- }
- #endif
- #ifdef L_roundl
- long double roundl (long double x)
- {
- return (long double) round( (double)x );
- }
- #endif
- #ifdef L_scalblnl
- long double scalblnl (long double x, long exp)
- {
- return (long double) scalbln( (double)x, exp );
- }
- #endif
- #ifdef L_scalbnl
- long double scalbnl (long double x, int exp)
- {
- return (long double) scalbn( (double)x, exp );
- }
- #endif
- #ifdef L_sinhl
- long double sinhl (long double x)
- {
- return (long double) sinh( (double)x );
- }
- #endif
- #ifdef L_sinl
- long double sinl (long double x)
- {
- return (long double) sin( (double)x );
- }
- #endif
- #ifdef L_sqrtl
- long double sqrtl (long double x)
- {
- return (long double) sqrt( (double)x );
- }
- #endif
- #ifdef L_tanhl
- long double tanhl (long double x)
- {
- return (long double) tanh( (double)x );
- }
- #endif
- #ifdef L_tanl
- long double tanl (long double x)
- {
- return (long double) tan( (double)x );
- }
- #endif
- #ifdef L_tgammal
- long double tgammal (long double x)
- {
- return (long double) tgamma( (double)x );
- }
- #endif
- #ifdef L_truncl
- long double truncl (long double x)
- {
- return (long double) trunc( (double)x );
- }
- #endif
|