Re: strtod ("nan") returns negative NaN
Corinna Vinschen <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <[email protected]> |
On Aug 15 11:51, Craig Howland wrote:
> On 08/15/2018 11:40 AM, Joseph Myers wrote:
> > On Wed, 15 Aug 2018, Joseph Myers wrote:
> >
> > > On Tue, 14 Aug 2018, Craig Howland wrote:
> > >
> > > > The f_QNAN value should be 0x7fc00000 regardless of byte ordering. In
> > > It would be better to use __builtin_nan ("") (and __builtin_nanf,
> > > __builtin_nanl for other types) rather than using an integer
> > > representation at all (of course that requires changes to other code to
> > > avoid requiring an integer representation there).
> I totally agree. To add it to the record, in conjunction with this, the
> strtod implementation really should be upgraded to David Gay's more recent
> version, which is 128-bit friendly. (I almost had this done some time ago,
> but didn't quite finish.)
> > (This is not an objection to any of the present patch proposals, just an
> > observation that a different approach would avoid a series of problems
> > that result from trying to hardcode information about such choices of
> > bit-patterns for NaNs.)
> >
> Also agreed. If I had had time yesterday I might have tried it as I had
> briefly thought of it, but didn't think to get the idea out to the list, so
> I'm glad you did.
Sounds like a nice followup patch...?
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlt0T1gACgkQ9TYGna5E T6BYkA//WMFE9oJVMbuoOc5A5EMU8OguCq8Hjv6OW6s/4Tji1g2cEjrpdNmrnf/l LH+6DxZoszOnPOnpTXvLoatJsKMorPtrHCDYlF9iwXkqSxW2O8YUEHpDqch0b391 SZkkoPYL+SRVfUDSb7S7+svuWblnd+C6HK0yM0R8Ri3z552a76bimH+8cvUJVCFe ONgsNdRi4glUMWlBhENNiQP8iaLO4/U+0vX5vUFUGJbnv1CnWSh7qFtkUH2dAYnm U9Cf6qebjyoaGnnzRoTA8Ng5JatP2SI4PyS7SPZvYAEMXv9HltKnkk4xJUTsJT8U zXeljVUAh2pHusYABhE9Z5Qdnbp7Km0Fq0di5U5m7RDe/Q21RUTlwxBxZtQ//1u+ KrNNSZwpsDTnZ7X5EvfUH2Y0mWP2iHXMlXk3SvxTTETeAAk6BzNnuUQ2GRU5FcWc oTwixmVcPzdaMlhCn8KmqivQhgwLxiIw1o9uPA9cSaZ/iW1p2L61LWW9EPYM2ttL eIzAzstXD3Z4Yoe4OsoEfP+zo+0dnTolvJ3T8B4/cR2Nz3oV+lIocaPZRsLtdQFg Ad3LgDqArysS1+iIk2RGHnEPnYWJ+KfrK+9L+KedEtUJ4oIssZDyjXYV/zjweH+W kfoK+VxCu8b7pYM2Y2PS8f7aOi+dc89toeb4B7Omas7P71PXFek= =sHdt -----END PGP SIGNATURE-----