summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754')
-rw-r--r--sysdeps/ieee754/ldbl-128/s_cosl.c10
-rw-r--r--sysdeps/ieee754/ldbl-128/s_expm1l.c6
-rw-r--r--sysdeps/ieee754/ldbl-128/s_sinl.c10
-rw-r--r--sysdeps/ieee754/ldbl-128/s_tanl.c10
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_cosl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_expm1l.c6
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_sinl.c8
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_tanl.c8
8 files changed, 54 insertions, 11 deletions
diff --git a/sysdeps/ieee754/ldbl-128/s_cosl.c b/sysdeps/ieee754/ldbl-128/s_cosl.c
index d1258b2cf1..ef61c3afdb 100644
--- a/sysdeps/ieee754/ldbl-128/s_cosl.c
+++ b/sysdeps/ieee754/ldbl-128/s_cosl.c
@@ -44,6 +44,7 @@
* TRIG(x) returns trig(x) nearly rounded
*/
+#include <errno.h>
#include "math.h"
#include "math_private.h"
@@ -66,7 +67,14 @@
return __kernel_cosl(x,z);
/* cos(Inf or NaN) is NaN */
- else if (ix>=0x7fff000000000000LL) return x-x;
+ else if (ix>=0x7fff000000000000LL) {
+ if (ix == 0x7fff000000000000LL) {
+ GET_LDOUBLE_LSW64(n,x);
+ if (n == 0)
+ __set_errno (EDOM);
+ }
+ return x-x;
+ }
/* argument reduction needed */
else {
diff --git a/sysdeps/ieee754/ldbl-128/s_expm1l.c b/sysdeps/ieee754/ldbl-128/s_expm1l.c
index 78bbe65b53..a82489bb24 100644
--- a/sysdeps/ieee754/ldbl-128/s_expm1l.c
+++ b/sysdeps/ieee754/ldbl-128/s_expm1l.c
@@ -53,6 +53,7 @@
+#include <errno.h>
#include "math.h"
#include "math_private.h"
@@ -121,7 +122,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-128/s_sinl.c b/sysdeps/ieee754/ldbl-128/s_sinl.c
index 446a75f126..dc509e72e5 100644
--- a/sysdeps/ieee754/ldbl-128/s_sinl.c
+++ b/sysdeps/ieee754/ldbl-128/s_sinl.c
@@ -44,6 +44,7 @@
* TRIG(x) returns trig(x) nearly rounded
*/
+#include <errno.h>
#include "math.h"
#include "math_private.h"
@@ -66,7 +67,14 @@
return __kernel_sinl(x,z,0);
/* sin(Inf or NaN) is NaN */
- else if (ix>=0x7fff000000000000LL) return x-x;
+ else if (ix>=0x7fff000000000000LL) {
+ if (ix == 0x7fff000000000000LL) {
+ GET_LDOUBLE_LSW64(n,x);
+ if (n == 0)
+ __set_errno (EDOM);
+ }
+ return x-x;
+ }
/* argument reduction needed */
else {
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 <errno.h>
#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 {
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_cosl.c b/sysdeps/ieee754/ldbl-128ibm/s_cosl.c
index 59a8196706..8470850fc8 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 <errno.h>
#include "math.h"
#include "math_private.h"
#include <math_ldbl_opt.h>
@@ -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 735006575f..f631eddf59 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 <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)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_sinl.c b/sysdeps/ieee754/ldbl-128ibm/s_sinl.c
index 8cc592c612..bd72225e18 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 <errno.h>
#include "math.h"
#include "math_private.h"
#include <math_ldbl_opt.h>
@@ -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 ea5a7f0ffb..913f38f243 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 <errno.h>
#include "math.h"
#include "math_private.h"
#include <math_ldbl_opt.h>
@@ -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);