diff options
Diffstat (limited to 'sysdeps/ieee754/ldbl-96/s_tanl.c')
-rw-r--r-- | sysdeps/ieee754/ldbl-96/s_tanl.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sysdeps/ieee754/ldbl-96/s_tanl.c b/sysdeps/ieee754/ldbl-96/s_tanl.c index 3054601a50..3fbe4a8f6b 100644 --- a/sysdeps/ieee754/ldbl-96/s_tanl.c +++ b/sysdeps/ieee754/ldbl-96/s_tanl.c @@ -48,23 +48,28 @@ static char rcsid[] = "$NetBSD: $"; * TRIG(x) returns trig(x) nearly rounded */ +#include <errno.h> #include <math.h> #include <math_private.h> long double __tanl(long double x) { long double y[2],z=0.0; - int32_t n, se; + int32_t n, se, i0, i1; /* High word of x. */ - GET_LDOUBLE_EXP(se,x); + GET_LDOUBLE_WORDS(se,i0,i1,x); /* |x| ~< pi/4 */ se &= 0x7fff; if(se <= 0x3ffe) return __kernel_tanl(x,z,1); /* tan(Inf or NaN) is NaN */ - else if (se==0x7fff) return x-x; /* NaN */ + else if (se==0x7fff) { + if (i1 == 0 && i0 == 0x80000000) + __set_errno (EDOM); + return x-x; + } /* argument reduction needed */ else { |