From 38ae768d88c47dd06030104eb3376212b0d8d164 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 22 May 2009 08:35:15 -0700 Subject: Fix errno for IBM long double. After the last addition to the math test suite PPC routines haven't been adjusted so far. --- sysdeps/ieee754/ldbl-128ibm/s_cosl.c | 7 +++++-- sysdeps/ieee754/ldbl-128ibm/s_expm1l.c | 6 +++++- sysdeps/ieee754/ldbl-128ibm/s_sinl.c | 8 ++++++-- sysdeps/ieee754/ldbl-128ibm/s_tanl.c | 8 ++++++-- 4 files changed, 22 insertions(+), 7 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/ieee754/ldbl-128ibm/s_cosl.c b/sysdeps/ieee754/ldbl-128ibm/s_cosl.c index 59a8196..8470850 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_cosl.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_cosl.c @@ -44,6 +44,7 @@ * TRIG(x) returns trig(x) nearly rounded */ +#include #include "math.h" #include "math_private.h" #include @@ -67,9 +68,11 @@ return __kernel_cosl(x,z); /* cos(Inf or NaN) is NaN */ - else if (ix>=0x7ff0000000000000LL) + else if (ix>=0x7ff0000000000000LL) { + if (ix == 0x7ff0000000000000LL) + __set_errno (EDOM); return x-x; - + } /* argument reduction needed */ else { n = __ieee754_rem_pio2l(x,y); diff --git a/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c b/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c index 7350065..f631edd 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c @@ -51,6 +51,7 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "math.h" #include "math_private.h" #include @@ -120,7 +121,10 @@ __expm1l (long double x) /* Overflow. */ if (x > maxlog) - return (big * big); + { + __set_errno (ERANGE); + return (big * big); + } /* Minimum value. */ if (x < minarg) diff --git a/sysdeps/ieee754/ldbl-128ibm/s_sinl.c b/sysdeps/ieee754/ldbl-128ibm/s_sinl.c index 8cc592c..bd72225 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_sinl.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_sinl.c @@ -44,6 +44,7 @@ * TRIG(x) returns trig(x) nearly rounded */ +#include #include "math.h" #include "math_private.h" #include @@ -67,8 +68,11 @@ return __kernel_sinl(x,z,0); /* sin(Inf or NaN) is NaN */ - else if (ix>=0x7ff0000000000000LL) return x-x; - + else if (ix>=0x7ff0000000000000LL) { + if (ix == 0x7ff0000000000000LL) + __set_errno (EDOM); + return x-x; + } /* argument reduction needed */ else { n = __ieee754_rem_pio2l(x,y); diff --git a/sysdeps/ieee754/ldbl-128ibm/s_tanl.c b/sysdeps/ieee754/ldbl-128ibm/s_tanl.c index ea5a7f0..913f38f 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_tanl.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_tanl.c @@ -44,6 +44,7 @@ * TRIG(x) returns trig(x) nearly rounded */ +#include #include "math.h" #include "math_private.h" #include @@ -66,8 +67,11 @@ if(ix <= 0x3fe921fb54442d10LL) return __kernel_tanl(x,z,1); /* tanl(Inf or NaN) is NaN */ - else if (ix>=0x7ff0000000000000LL) return x-x; /* NaN */ - + else if (ix>=0x7ff0000000000000LL) { + if (ix == 0x7ff0000000000000LL) + __set_errno (EDOM); + return x-x; /* NaN */ + } /* argument reduction needed */ else { n = __ieee754_rem_pio2l(x,y); -- cgit v1.1