delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/08/14/17:09:06

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:to:from:subject:date:message-id:references
:mime-version:content-type; q=dns; s=default; b=DEwf1WbpJPiAbgN5
G56em0193EnXVC4c96L690NsZWwacDD+f5O0eKVasgcV8cWOMnKt0swG7O/CJpxx
Izi8dySfCDtZnVJSBJ+sLm/UCq0SNAvY2vgHVhbCcEI0y4mM8cTqzrf4sPueRdaa
RJELAI6+d7odt8lmALkP8rbL8lc=
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:to:from:subject:date:message-id:references
:mime-version:content-type; s=default; bh=bfePPFHxzKKpDRstXeZL6h
DJupI=; b=Bk4vAPiat/K3WrpOJHMcp8Q0WPgA3jvaRK6hGYBMHdSW/swpBiVBFl
NHddsyfURYxWZT94PxXEOGStYrZQAjBNiWuybYK/Nl6Cy+kKlxft5FUo+hnpLh7T
s+013KpWSpusON9BbNb/F+AJJkAjce4Eg2IJeYrOBUpiw8+kd150I=
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=-0.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=wherever, H*r:Unknown, international, International
X-HELO: blaine.gmane.org
To: cygwin AT cygwin DOT com
From: Andy Moreton <andrewjmoreton AT gmail DOT com>
Subject: Re: strtod ("nan") returns negative NaN
Date: Tue, 14 Aug 2018 22:08:41 +0100
Lines: 14
Message-ID: <8636vgac6e.fsf@gmail.com>
References: <20180814132301 DOT GX3747 AT calimero DOT vinschen DOT de> <5b730d82 DOT 1c69fb81 DOT f063b DOT d706 AT mx DOT google DOT com>
Mime-Version: 1.0
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (windows-nt)
X-IsSubscribed: yes

On Tue 14 Aug 2018, Steven Penny wrote:
> a number can be positive or negative. as "NaN" is by definition not a number,
> it cannot be positive or negative, it is simply itself, something anathema to
> a number.

The C standard disagrees with you [ISO:IEC 9899:2011, section 5.2.4.2.2]:

"An implementation may give zero and values that are not floating-point
numbers (such as infinities and NaNs) a sign or may leave them unsigned.
Wherever such values are unsigned, any requirement in this International
Standard to retrieve the sign shall produce an unspecified sign, and any
requirement to set the sign shall be ignored."

    AndyM


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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