delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/08/14/11:35:44

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=ItPDeU3OYzUVg8ajLwNKhfKVsR1kGRoD/F7jPgM7C1aCdImqE1SOr
96mFpFAmo3lgQ0BJule+qQvwlaStyPTpp3IkF6iSVQ58zQwX1lq5LU2286QJDVJj
yYbKRt1366sTLcMAj1faBKz4N4Kj8kMI4fmYVKhD0WoOaO6FZ8Ei80=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=i5hvtzMzYtxx8T8BPP5mCNLb/sM=; b=DsZUwgixavL4jqpwZXVhpeu5V4lk
aLhYCCRby8klLR1pgTIluBpzWBHRKwiKykc+urXnXcfZdnWzyAGSe4ohb8krTjNS
swnPOfUKIAaTFssTjadPK3UWdi0GeaT3tdURFSXsPSyvg1+qftZL228yGFaoCBY8
DikpIoR01oU4uhY=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-101.2 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=
X-HELO: mout.kundenserver.de
Date: Tue, 14 Aug 2018 17:35:28 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: strtod ("nan") returns negative NaN
Message-ID: <20180814153528.GY3747@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20180814095618 DOT GT3747 AT calimero DOT vinschen DOT de> <20180814095618_dot_GT3747_at_calimero_dot_vinschen_dot_de> <20180814103900 DOT GU3747 AT calimero DOT vinschen DOT de> <20180814 DOT 211757 DOT 2066454831159853501 DOT trueroad AT trueroad DOT jp> <20180814132301 DOT GX3747 AT calimero DOT vinschen DOT de> <1e04c237-70f8-5cc9-7dae-d00e3bfea39d AT avenger DOT ws>
MIME-Version: 1.0
In-Reply-To: <1e04c237-70f8-5cc9-7dae-d00e3bfea39d@avenger.ws>
User-Agent: Mutt/1.9.2 (2017-12-15)

--Sx3M3By4KbPIrykT
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Aug 14 12:20, Heavenly Avenger wrote:
> On 8/14/2018 10:23 AM, Corinna Vinschen wrote:
> > I just wonder why returning -NaN when the input is "-nan" isn't the
> > better approach.  After all:
> >=20
> >    printf ("nan (\"\") =3D %f\n", nan (""));
> >    printf ("-nan (\"\") =3D %f\n", -nan (""));
> >=20
> > =3D=3D>
> >=20
> >    nan ("") =3D nan
> >    -nan ("") =3D -nan
> >=20
> > So, shouldn't the ideal outcome be this:
> >=20
> >    strtod ("nan", NULL) =3D nan
> >    strtod ("-nan", NULL) =3D -nan
> >    strtold ("nan", NULL) =3D nan
> >    strtold ("-nan", NULL) =3D -nan
> >=20
> > ?
> >=20
> > Corinna
> >=20
> I'd say it is not the better/best approach as, even though it makes sense,
> all other implementations or linux distributions treat it as a plain "nan=
".
> So anything written for linux will potentially break on cygwin, I am not
> sure this is the idea behind cygwin, right?

My point is, even the glibc printf prints a negative NaN as "-nan",
see above.  strtod/strtold returning a different NaN value looks
inconsistent.

Well, never mind.


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--Sx3M3By4KbPIrykT
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlty9r8ACgkQ9TYGna5E
T6AbYRAAgmKUy8IJ2zH8EImkYrvdabx/25FDUtXAH0dVTBHLUShs6bCpXWLLADKv
OYGZjfTgjdwyEKNsimooqpAzURnDvn0vYuGmaJH1T05+xcxr53G/fI1PUWTjZEn7
Qzh/MKTmFlqKWbzWyVmviLot2IcudxRbWxu/wnvKsMfIKoY6OLLUPmfRKFAPBW4n
cx8cKtYnLGj6d3WyCJQ7dUc0vZ7ZnQNl8aHZMkQLBcB2Z0+hVKWdqkKK/BFVuRl1
hlFHqAGT41gRDSMbf5L/HEz9K759RgBqNDoUQ4xM/hddbzqUWgTqzLw8Ye5gBGWf
Pfyhs2qF2SrCUSaTvfd7iPZ1CkZd9tPX8O2aztv8/JKGUf9Vxue67SlUGn5d978A
06eojztVwErON85Z0AcEUljWKoWWW4p4JngvCWUHryEs/D8J7swVAsrFIK9eZccr
kYJPJHnE0ucbBBhPxYS2s+EPtLdmbluK3ykNfiDlqLc132Fz1t6Urvkbmi8OTdNa
VxvKjftmOhOp5IU9M0LrHrIV/FXuAitjzVhrrIMVx9TbMFw1hWQzpn6v8Pda2o7Z
w0ysEkbSqBeXHjjAkvhcQektZc37ncsGvG/mHVaJ7OlwdenU70Z9F/vFv59gCJG6
yaNlLmpmP900coEacQ06JUuUR743c9PD9eVZLWJa6HacMAYBWE0=
=/Idc
-----END PGP SIGNATURE-----

--Sx3M3By4KbPIrykT--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019