This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix ldbl-128ibm log1pl (-1) sign of infinity (bug 19076) [committed]


The ldbl-128ibm implementation of log1pl produces an infinity with the
wrong sign for log1pl (-1) in FE_DOWNWARD mode.  This patch fixes this
by changing a division (-1.0L / (x - x)) (incorrect in FE_DOWNWARD
mode) to (-1.0L / 0.0L) (correct in all rounding modes).

Tested for powerpc.  Committed.

2015-10-06  Joseph Myers  <joseph@codesourcery.com>

	[BZ #19076]
	* sysdeps/ieee754/ldbl-128ibm/s_log1pl.c (__log1pl): Divide by
	constant 0.0L when computing infinite result.

diff --git a/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c b/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c
index a0e24d7..ad9a1fe 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c
@@ -149,7 +149,7 @@ __log1pl (long double xm1)
   if (x <= 0.0L)
     {
       if (x == 0.0L)
-	return (-1.0L / (x - x));
+	return (-1.0L / 0.0L);
       else
 	return (zero / (x - x));
     }

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]