This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [BZ #15522] strtod ("nan(N)") returning a sNaN in some cases
- From: "Ryan S. Arnold" <ryan dot arnold at gmail dot com>
- To: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Fri, 7 Jun 2013 12:27:20 -0500
- Subject: Re: [BZ #15522] strtod ("nan(N)") returning a sNaN in some cases
- References: <87zjvlhek5 dot fsf at schwinge dot name> <51B216A0 dot 2020006 at linux dot vnet dot ibm dot com>
On Fri, Jun 7, 2013 at 12:21 PM, Adhemerval Zanella
<azanella@linux.vnet.ibm.com> wrote:
> Hi Thomas,
>
> 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.
I'll defer to Adhemerval on this one.
Ryan