From 7f3394bdf34e28b374e5569a7a74ddac734fb172 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 29 May 2009 12:00:22 -0700 Subject: Fix errno for boundary conditions in 128-bit long double. Similar to the changes which went already in for the other formats, follow POSIX rules for errno. --- sysdeps/ieee754/ldbl-128/s_tanl.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sysdeps/ieee754/ldbl-128/s_tanl.c') diff --git a/sysdeps/ieee754/ldbl-128/s_tanl.c b/sysdeps/ieee754/ldbl-128/s_tanl.c index ea9d053d9b..2349da67f1 100644 --- a/sysdeps/ieee754/ldbl-128/s_tanl.c +++ b/sysdeps/ieee754/ldbl-128/s_tanl.c @@ -44,6 +44,7 @@ * TRIG(x) returns trig(x) nearly rounded */ +#include #include "math.h" #include "math_private.h" @@ -65,7 +66,14 @@ if(ix <= 0x3ffe921fb54442d1LL) return __kernel_tanl(x,z,1); /* tanl(Inf or NaN) is NaN */ - else if (ix>=0x7fff000000000000LL) return x-x; /* NaN */ + else if (ix>=0x7fff000000000000LL) { + if (ix == 0x7fff000000000000LL) { + GET_LDOUBLE_LSW64(n,x); + if (n == 0) + __set_errno (EDOM); + } + return x-x; /* NaN */ + } /* argument reduction needed */ else { -- cgit 1.4.1