]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix errno for IBM long double.
authorAndreas Schwab <schwab@linux-m68k.org>
Fri, 22 May 2009 15:35:15 +0000 (08:35 -0700)
committerUlrich Drepper <drepper@redhat.com>
Fri, 22 May 2009 15:35:15 +0000 (08:35 -0700)
After the last addition to the math test suite PPC routines haven't
been adjusted so far.

ChangeLog
sysdeps/ieee754/ldbl-128ibm/s_cosl.c
sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
sysdeps/ieee754/ldbl-128ibm/s_sinl.c
sysdeps/ieee754/ldbl-128ibm/s_tanl.c

index 2c1d66ca436437793359698a724fa245299762c5..45be576e1db610ab48e7aa9a56c0c1f9a3a50b59 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-05-22  Andreas Schwab  <schwab@linux-m68k.org>
 
+       * sysdeps/ieee754/ldbl-128ibm/s_sinl.c: Set errno for ±Inf.
+       * sysdeps/ieee754/ldbl-128ibm/s_cosl.c: Likewise.
+       * sysdeps/ieee754/ldbl-128ibm/s_tanl.c: Likewise.
+       * sysdeps/ieee754/ldbl-128ibm/s_expm1l.c: Set errno for overflow.
+
        * sysdeps/powerpc/powerpc32/____longjmp_chk.S: New file.
        * sysdeps/powerpc/powerpc64/____longjmp_chk.S: New file.
        * sysdeps/powerpc/powerpc32/__longjmp-common.S: Use CHECK_SP if
index 59a819670691618132cde8bcc33990887768d01e..8470850fc8c6c6bad64d55725667eee7bf64f0ad 100644 (file)
@@ -44,6 +44,7 @@
  *     TRIG(x) returns trig(x) nearly rounded
  */
 
+#include <errno.h>
 #include "math.h"
 #include "math_private.h"
 #include <math_ldbl_opt.h>
          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);
index 735006575fa405e3a10f4744357803bffe0a3a5c..f631eddf59059b947515b27b4bda198c9b50ed2c 100644 (file)
@@ -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 <errno.h>
 #include "math.h"
 #include "math_private.h"
 #include <math_ldbl_opt.h>
@@ -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)
index 8cc592c612d316ab4c9c29ae3f2a60f0a21dc5f3..bd72225e1860ac7ce459afb719cf350435545fb6 100644 (file)
@@ -44,6 +44,7 @@
  *     TRIG(x) returns trig(x) nearly rounded
  */
 
+#include <errno.h>
 #include "math.h"
 #include "math_private.h"
 #include <math_ldbl_opt.h>
          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);
index ea5a7f0ffb7fd44c541b5eb2fe7e6b8a8b4c6004..913f38f243335f8bc9574a1ad97fbab776e8ae87 100644 (file)
@@ -44,6 +44,7 @@
  *     TRIG(x) returns trig(x) nearly rounded
  */
 
+#include <errno.h>
 #include "math.h"
 #include "math_private.h"
 #include <math_ldbl_opt.h>
        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);