mirror of git://sourceware.org/git/glibc.git
Fix sign of inexact zero results for ldbl-128ibm fmal.
This commit is contained in:
parent
ef1e0867c0
commit
c60d3bf2fa
|
@ -1,5 +1,9 @@
|
||||||
2012-11-22 Joseph Myers <joseph@codesourcery.com>
|
2012-11-22 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
[BZ #14645]
|
||||||
|
* sysdeps/ieee754/ldbl-128ibm/s_fmal.c (__fmal): Compute result as
|
||||||
|
x * y if x and y are nonzero and z is zero.
|
||||||
|
|
||||||
[BZ #14811]
|
[BZ #14811]
|
||||||
* sysdeps/ieee754/ldbl-128ibm/e_powl.c (__ieee754_powl): Saturate
|
* sysdeps/ieee754/ldbl-128ibm/e_powl.c (__ieee754_powl): Saturate
|
||||||
nonzero exponents with absolute value below 0x1p-117 to +/-
|
nonzero exponents with absolute value below 0x1p-117 to +/-
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Compute x * y + z as ternary operation.
|
/* Compute x * y + z as ternary operation.
|
||||||
Copyright (C) 2011 Free Software Foundation, Inc.
|
Copyright (C) 2011-2012 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by David Flaherty <flaherty@linux.vnet.ibm.com>.
|
Contributed by David Flaherty <flaherty@linux.vnet.ibm.com>.
|
||||||
|
|
||||||
|
@ -29,6 +29,12 @@ __fmal (long double x, long double y, long double z)
|
||||||
if ((finite ((double)x) && finite ((double)y)) && isinf ((double)z))
|
if ((finite ((double)x) && finite ((double)y)) && isinf ((double)z))
|
||||||
return (z);
|
return (z);
|
||||||
|
|
||||||
|
/* If z is zero and x are y are nonzero, compute the result
|
||||||
|
as x * y to avoid the wrong sign of a zero result if x * y
|
||||||
|
underflows to 0. */
|
||||||
|
if (z == 0 && x != 0 && y != 0)
|
||||||
|
return x * y;
|
||||||
|
|
||||||
return (x * y) + z;
|
return (x * y) + z;
|
||||||
}
|
}
|
||||||
#ifdef IS_IN_libm
|
#ifdef IS_IN_libm
|
||||||
|
|
Loading…
Reference in New Issue