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: [BZ #15522] strtod ("nan(N)") returning a sNaN in some cases


Hi!

On Fri, 07 Jun 2013 14:21:36 -0300, Adhemerval Zanella <azanella@linux.vnet.ibm.com> wrote:
> Regarding IBM long double:
> 
> 
> On 23-05-2013 13:00, Thomas Schwinge wrote:
> > diff --git sysdeps/ieee754/ldbl-128ibm/ieee754.h sysdeps/ieee754/ldbl-128ibm/ieee754.h
> > index e5644f5..9e94f53 100644
> > --- sysdeps/ieee754/ldbl-128ibm/ieee754.h
> > +++ sysdeps/ieee754/ldbl-128ibm/ieee754.h
> > @@ -199,6 +199,25 @@ union ibm_extended_long_double
> >  	unsigned int mantissa2:20;
> >  	unsigned int mantissa3:32;
> >        } ieee;
> > +
> > +    /* This format makes it easier to see if a NaN is a signalling NaN.  */
> > +    struct
> > +      { /* Big endian.  There is no other.  */
> > +
> > +	unsigned int negative:1;
> > +	unsigned int exponent:11;
> > +	unsigned int quiet_nan:1;
> > +	/* Together Mantissa0-3 comprise the mantissa.  */
> > +	unsigned int mantissa0:19;
> > +	unsigned int mantissa1:32;
> > +
> > +	unsigned int negative2:1;
> > +	unsigned int exponent2:11;
> > +	/* There is an implied 1 here?  */
> > +	/* Together these comprise the mantissa.  */
> > +	unsigned int mantissa2:20;
> > +	unsigned int mantissa3:32;
> > +      } ieee_nan;
> >     };
> 
> The second double is ignored on NaN representation for IBM long double 
> (check sysdeps/ieee754/ldbl-128ibm/s_isnanl.c), so no implied 1 here.
> Rest looks ok, thanks.

Thanks for the review.  Note that ieee_nan is mostly a verbatim copy of
the ieee just above, including these Âimplied 1Â comment, so that should
either be changed for both after my patch is in, or first be changed
above before my patch is committed.


GrÃÃe,
 Thomas

Attachment: pgphlMEgKBmcO.pgp
Description: PGP signature


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