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: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Fri, 07 Jun 2013 14:21:36 -0300
- Subject: Re: [BZ #15522] strtod ("nan(N)") returning a sNaN in some cases
- References: <87zjvlhek5 dot fsf at schwinge dot name>
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.