diff options
Diffstat (limited to 'sysdeps/ieee754')
-rw-r--r-- | sysdeps/ieee754/dbl-64/e_hypot.c | 2 | ||||
-rw-r--r-- | sysdeps/ieee754/flt-32/e_hypotf.c | 4 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128/e_hypotl.c | 2 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_hypotl.c | 2 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-96/e_hypotl.c | 2 |
5 files changed, 10 insertions, 2 deletions
diff --git a/sysdeps/ieee754/dbl-64/e_hypot.c b/sysdeps/ieee754/dbl-64/e_hypot.c index f142c45..76eb408 100644 --- a/sysdeps/ieee754/dbl-64/e_hypot.c +++ b/sysdeps/ieee754/dbl-64/e_hypot.c @@ -76,6 +76,8 @@ __ieee754_hypot (double x, double y) { u_int32_t low; w = a + b; /* for sNaN */ + if (issignaling (a) || issignaling (b)) + return w; GET_LOW_WORD (low, a); if (((ha & 0xfffff) | low) == 0) w = a; diff --git a/sysdeps/ieee754/flt-32/e_hypotf.c b/sysdeps/ieee754/flt-32/e_hypotf.c index 717b82e..fda2651 100644 --- a/sysdeps/ieee754/flt-32/e_hypotf.c +++ b/sysdeps/ieee754/flt-32/e_hypotf.c @@ -26,9 +26,9 @@ __ieee754_hypotf(float x, float y) ha &= 0x7fffffff; GET_FLOAT_WORD(hb,y); hb &= 0x7fffffff; - if (ha == 0x7f800000) + if (ha == 0x7f800000 && !issignaling (y)) return fabsf(x); - else if (hb == 0x7f800000) + else if (hb == 0x7f800000 && !issignaling (x)) return fabsf(y); else if (ha > 0x7f800000 || hb > 0x7f800000) return fabsf(x) * fabsf(y); diff --git a/sysdeps/ieee754/ldbl-128/e_hypotl.c b/sysdeps/ieee754/ldbl-128/e_hypotl.c index a93f5a4..6c4e178 100644 --- a/sysdeps/ieee754/ldbl-128/e_hypotl.c +++ b/sysdeps/ieee754/ldbl-128/e_hypotl.c @@ -67,6 +67,8 @@ __ieee754_hypotl(_Float128 x, _Float128 y) if(ha >= 0x7fff000000000000LL) { /* Inf or NaN */ u_int64_t low; w = a+b; /* for sNaN */ + if (issignaling (a) || issignaling (b)) + return w; GET_LDOUBLE_LSW64(low,a); if(((ha&0xffffffffffffLL)|low)==0) w = a; GET_LDOUBLE_LSW64(low,b); diff --git a/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c b/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c index c68dac0..de5a66a 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c @@ -67,6 +67,8 @@ __ieee754_hypotl(long double x, long double y) if(ha > 0x5f30000000000000LL) { /* a>2**500 */ if(ha >= 0x7ff0000000000000LL) { /* Inf or NaN */ w = a+b; /* for sNaN */ + if (issignaling (a) || issignaling (b)) + return w; if(ha == 0x7ff0000000000000LL) w = a; if(hb == 0x7ff0000000000000LL) diff --git a/sysdeps/ieee754/ldbl-96/e_hypotl.c b/sysdeps/ieee754/ldbl-96/e_hypotl.c index ee3a070..6b55b6d 100644 --- a/sysdeps/ieee754/ldbl-96/e_hypotl.c +++ b/sysdeps/ieee754/ldbl-96/e_hypotl.c @@ -68,6 +68,8 @@ long double __ieee754_hypotl(long double x, long double y) u_int32_t exp __attribute__ ((unused)); u_int32_t high,low; w = a+b; /* for sNaN */ + if (issignaling (a) || issignaling (b)) + return w; GET_LDOUBLE_WORDS(exp,high,low,a); if(((high&0x7fffffff)|low)==0) w = a; GET_LDOUBLE_WORDS(exp,high,low,b); |