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


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


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