mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-25 22:40:05 +00:00
[BZ #16823] Fix log1pl returning wrong infinity sign
This commit is contained in:
parent
dc041bd4db
commit
2ca180e97a
@ -1,3 +1,11 @@
|
||||
2014-04-29 Stefan Liebler <stli@linux.vnet.ibm.com>
|
||||
|
||||
[BZ #16823]
|
||||
* sysdeps/ieee754/ldbl-128/s_log1pl.c (__log1pl):
|
||||
Always divide by positive zero when computing -Inf result.
|
||||
* sysdeps/ieee754/dbl-64/s_log1p.c (__log1p): Likewise.
|
||||
* sysdeps/ieee754/flt-32/s_log1pf.c (__log1pf): Likewise.
|
||||
|
||||
2014-04-28 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
|
||||
|
||||
* sysdeps/powerpc/fpu/fclrexcpt.c (__feclearexcept): Do not update
|
||||
|
@ -110,7 +110,7 @@ __log1p (double x)
|
||||
if (__glibc_unlikely (ax >= 0x3ff00000)) /* x <= -1.0 */
|
||||
{
|
||||
if (x == -1.0)
|
||||
return -two54 / (x - x); /* log1p(-1)=+inf */
|
||||
return -two54 / zero; /* log1p(-1)=-inf */
|
||||
else
|
||||
return (x - x) / (x - x); /* log1p(x<-1)=NaN */
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ __log1pf(float x)
|
||||
k = 1;
|
||||
if (hx < 0x3ed413d7) { /* x < 0.41422 */
|
||||
if(ax>=0x3f800000) { /* x <= -1.0 */
|
||||
if(x==(float)-1.0) return -two25/(x-x); /* log1p(-1)=+inf */
|
||||
if(x==(float)-1.0) return -two25/zero; /* log1p(-1)=-inf */
|
||||
else return (x-x)/(x-x); /* log1p(x<-1)=NaN */
|
||||
}
|
||||
if(ax<0x31000000) { /* |x| < 2**-29 */
|
||||
|
@ -150,7 +150,7 @@ __log1pl (long double xm1)
|
||||
if (x <= 0.0L)
|
||||
{
|
||||
if (x == 0.0L)
|
||||
return (-1.0L / (x - x));
|
||||
return (-1.0L / zero); /* log1p(-1) = -inf */
|
||||
else
|
||||
return (zero / (x - x));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user