about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2001-04-10 19:58:52 +0000
committerAndreas Schwab <schwab@suse.de>2001-04-10 19:58:52 +0000
commitd2784f806c372873fba6262e5c8164429afa4a06 (patch)
treea120f2f4b334ae0ffe865ea2083004edaa0e6461
parent9deee4bb2a7461507eb08acafef926d291beecc4 (diff)
downloadglibc-d2784f806c372873fba6262e5c8164429afa4a06.tar.gz
glibc-d2784f806c372873fba6262e5c8164429afa4a06.tar.xz
glibc-d2784f806c372873fba6262e5c8164429afa4a06.zip
* sysdeps/m68k/fpu/e_pow.c: Correct handling of some exceptional
values. 
* sysdeps/m68k/fpu/e_scalb.c: Likewise.
2001-04-10  Andreas Schwab  <schwab@suse.de>

	* sysdeps/m68k/fpu/e_pow.c: Correct handling of some exceptional
	values.
	* sysdeps/m68k/fpu/e_scalb.c: Likewise.
-rw-r--r--ChangeLog6
-rw-r--r--sysdeps/m68k/fpu/e_pow.c14
-rw-r--r--sysdeps/m68k/fpu/e_scalb.c5
3 files changed, 16 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index ead62e5481..77c8e3c62e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-04-10  Andreas Schwab  <schwab@suse.de>
+
+	* sysdeps/m68k/fpu/e_pow.c: Correct handling of some exceptional
+	values.
+	* sysdeps/m68k/fpu/e_scalb.c: Likewise.
+
 2001-04-09  Ulrich Drepper  <drepper@redhat.com>
 
 	* sysdeps/sparc/sparc32/sparcv9/Dist: Add hp-timing.c.
diff --git a/sysdeps/m68k/fpu/e_pow.c b/sysdeps/m68k/fpu/e_pow.c
index 3dc3d819ab..b461ad86c4 100644
--- a/sysdeps/m68k/fpu/e_pow.c
+++ b/sysdeps/m68k/fpu/e_pow.c
@@ -41,23 +41,25 @@ s(__ieee754_pow) (float_type x, float_type y)
   y_cond = __m81_test (y);
   if (y_cond & __M81_COND_ZERO)
     return 1.0;
+  if (y_cond & __M81_COND_NAN)
+    return x == 1.0 ? x : x + y;
 
   x_cond = __m81_test (x);
-  if ((x_cond | y_cond) & __M81_COND_NAN)
+  if (x_cond & __M81_COND_NAN)
     return x + y;
 
   if (y_cond & __M81_COND_INF)
     {
       ax = s(fabs) (x);
-      if (ax == 1)
-	return y - y;
-      if (ax > 1)
+      if (ax == 1.0)
+	return ax;
+      if (ax > 1.0)
 	return y_cond & __M81_COND_NEG ? 0 : y;
       else
 	return y_cond & __M81_COND_NEG ? -y : 0;
     }
 
-  if (s(fabs) (y) == 1)
+  if (s(fabs) (y) == 1.0)
     return y_cond & __M81_COND_NEG ? 1 / x : x;
 
   if (y == 2)
@@ -77,7 +79,7 @@ s(__ieee754_pow) (float_type x, float_type y)
     }
 
   ax = s(fabs) (x);
-  if (x_cond & (__M81_COND_INF | __M81_COND_ZERO) || ax == 1)
+  if (x_cond & (__M81_COND_INF | __M81_COND_ZERO) || ax == 1.0)
     {
       z = ax;
       if (y_cond & __M81_COND_NEG)
diff --git a/sysdeps/m68k/fpu/e_scalb.c b/sysdeps/m68k/fpu/e_scalb.c
index 22332ca3ad..7f56199a9a 100644
--- a/sysdeps/m68k/fpu/e_scalb.c
+++ b/sysdeps/m68k/fpu/e_scalb.c
@@ -18,6 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <math.h>
+#include "math_private.h"
 #include "mathimpl.h"
 
 #ifndef SUFF
@@ -47,14 +48,12 @@ s(__ieee754_scalb) (float_type x, float_type fn)
 	return x * fn;
       else if (x_cond & __M81_COND_ZERO)
 	return x;
-      else if (x_cond & __M81_COND_INF)
-	return 0.0/0.0;
       else
 	return x / -fn;
     }
 
   if (m81(__rint) (fn) != fn)
-    return 0.0/0.0;
+    return (x - x) / (x - x);
 
   __asm ("fscale%.x %1, %0" : "=f" (retval) : "f" (fn), "0" (x));
   return retval;