diff options
author | Bruno Haible <bruno@clisp.org> | 2011-10-11 02:55:56 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2011-10-11 03:03:03 +0200 |
commit | fa11421b5098e20c33003e3f3375b830524c717a (patch) | |
tree | 78765a71e278c80f28d665334ddfe5a5f195438e /lib/cosl.c | |
parent | 030dc7afa953442437474140ac98ab4f8db56bc8 (diff) | |
download | gnulib-fa11421b5098e20c33003e3f3375b830524c717a.tar.gz |
cosl: Simplify for platforms where 'long double' == 'double'.
* lib/cosl.c (cosl) [HAVE_SAME_LONG_DOUBLE_AS_DOUBLE]: New alternative
implementation.
* m4/cosl.m4 (gl_FUNC_COSL): Require gl_LONG_DOUBLE_VS_DOUBLE.
Determine COSL_LIBM according to HAVE_SAME_LONG_DOUBLE_AS_DOUBLE.
* modules/cosl (Depends-on): Add cos. Update conditions.
(configure.ac): Don't compile sincosl.c and trigl.c if
HAVE_SAME_LONG_DOUBLE_AS_DOUBLE.
Diffstat (limited to 'lib/cosl.c')
-rw-r--r-- | lib/cosl.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/cosl.c b/lib/cosl.c index d23c15f029..a3eaf3947f 100644 --- a/lib/cosl.c +++ b/lib/cosl.c @@ -18,6 +18,16 @@ /* Specification. */ #include <math.h> +#if HAVE_SAME_LONG_DOUBLE_AS_DOUBLE + +long double +cosl (long double x) +{ + return cos (x); +} + +#else + /* sinl(x) * Return sine function of x. * @@ -49,7 +59,7 @@ * TRIG(x) returns trig(x) nearly rounded */ -#include "trigl.h" +# include "trigl.h" long double cosl (long double x) @@ -88,6 +98,8 @@ cosl (long double x) } } +#endif + #if 0 int main (void) |