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]

Re: Ping Re: Fix strtod rounding (bug 3479)


On 09/05/2012 11:50 AM, Joseph S. Myers wrote:
> On Wed, 5 Sep 2012, Andreas Schwab wrote:
>
>> That doesn't appear to work with IBM long double:
> See what I said in 
> <http://sourceware.org/ml/libc-alpha/2012-08/msg00603.html> (current 
> version <http://sourceware.org/ml/libc-alpha/2012-09/msg00069.html>, 
> pending review).
>
This patch fixes the IBM long double 'tst-strtod-overflow' failures.
Tested on PPC32 and PPC64.


2012-09-11  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>

	[BZ #14551]
	sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c: (__mpn_construct_long_double):
	Fix the overflow long double generation.


---
 sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c b/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
index b49ad96..53528d1 100644
--- a/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
@@ -134,7 +134,7 @@ __mpn_construct_long_double (mp_srcptr frac_ptr, int expt, int sign)
 	  lo = lo << lzcount;
 	  exponent2 = exponent2 - lzcount;
 	}
-      if (exponent2 > 0)
+      if (exponent2 > 0 && u.ieee.exponent < 0x7FF)
 	u.ieee.exponent2 = exponent2;
       else
 	lo >>= 1 - exponent2;

-- 
Adhemerval Zanella Netto
  Software Engineer
  Linux Technology Center Brazil
  Toolchain / GLIBC on Power Architecture
  azanella@linux.vnet.ibm.com / azanella@br.ibm.com
  +55 61 8642-9890


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