From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59538 invoked by alias); 14 Aug 2018 21:08:55 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 59525 invoked by uid 89); 14 Aug 2018 21:08:55 -0000 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 Received: from Unknown (HELO blaine.gmane.org) (195.159.176.226) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 Aug 2018 21:08:54 +0000 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fpgWU-0000T6-UI for cygwin@cygwin.com; Tue, 14 Aug 2018 23:06:38 +0200 To: cygwin@cygwin.com From: Andy Moreton Subject: Re: strtod ("nan") returns negative NaN Date: Tue, 14 Aug 2018 21:45:00 -0000 Message-ID: <8636vgac6e.fsf@gmail.com> References: <20180814132301.GX3747@calimero.vinschen.de> <5b730d82.1c69fb81.f063b.d706@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (windows-nt) X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00193.txt.bz2 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