From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118201 invoked by alias); 14 Aug 2018 16:05:37 -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 118178 invoked by uid 89); 14 Aug 2018 16:05:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS,WEIRD_QUOTING autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: mail.avenger.ws Received: from mail.avenger.ws (HELO mail.avenger.ws) (173.208.129.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 Aug 2018 16:05:35 +0000 Received: from [IPv6:2804:14c:5b70:9002:7ccd:aa44:a280:b193] (unknown [IPv6:2804:14c:5b70:9002:7ccd:aa44:a280:b193]) by mail.avenger.ws (Postfix) with ESMTPSA id D83264E12DC for ; Tue, 14 Aug 2018 13:05:13 -0300 (-03) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=avenger.ws; s=ethereal; t=1534262714; bh=NF3gGNRKlU4xYsXNZcQWXXbzCWO4EULBATTLmy7aqWA=; h=Subject:To:References:From:Date:In-Reply-To; b=5ytofuAQ4jS7M8lZ3JXDfU1LAV0GdZBuT7zYXGCfS0vcNjGleUEqCo9ZvTbAUkYxF 1pAvlIBkXlHp6qUIPV/p2Ax/FGLIu9aHNDpTt1VgEslAbc5HHtFaAilIxpsqlWm1uy k2GBH/1XQT3qGT9zwx2Vz9GGXfcOrFVXX7gFoWZY= Subject: Re: strtod ("nan") returns negative NaN To: cygwin@cygwin.com References: <20180814095618.GT3747@calimero.vinschen.de> <20180814095618_dot_GT3747_at_calimero_dot_vinschen_dot_de> <20180814103900.GU3747@calimero.vinschen.de> <20180814.211757.2066454831159853501.trueroad@trueroad.jp> <20180814132301.GX3747@calimero.vinschen.de> <1e04c237-70f8-5cc9-7dae-d00e3bfea39d@avenger.ws> <20180814153528.GY3747@calimero.vinschen.de> From: Heavenly Avenger Message-ID: Date: Tue, 14 Aug 2018 17:08:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180814153528.GY3747@calimero.vinschen.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00184.txt.bz2 Well, that's what I get in linux and cygwin for: #include #include #include /* the last two printfs requires this */ int main (void) {   printf ("strtof (\"nan\", NULL) = %f\n", strtof ("nan", NULL));   printf ("strtof (\"-nan\", NULL) = %f\n", strtof ("-nan", NULL));   printf ("strtod (\"nan\", NULL) = %f\n", strtod ("nan", NULL));   printf ("strtod (\"-nan\", NULL) = %f\n", strtod ("-nan", NULL));   printf ("strtold (\"nan\", NULL) = %Lf\n", strtold ("nan", NULL));   printf ("strtold (\"-nan\", NULL) = %Lf\n", strtold ("-nan", NULL));   printf ("nan (\"\") = %f\n", nan (""));   printf ("-nan (\"\") = %f\n", -nan ("")); } I get: Gentoo Linux (native linux) strtof ("nan", NULL) = nan strtof ("-nan", NULL) = nan strtod ("nan", NULL) = nan strtod ("-nan", NULL) = nan strtold ("nan", NULL) = nan strtold ("-nan", NULL) = nan nan ("") = nan -nan ("") = -nan cygwin 2.10.0: strtof ("nan", NULL) = nan strtof ("-nan", NULL) = nan strtod ("nan", NULL) = -nan strtod ("-nan", NULL) = nan strtold ("nan", NULL) = -nan strtold ("-nan", NULL) = -nan nan ("") = nan -nan ("") = -nan So, let's hope the patch does not transform the behavior from the nan from math.h. And yes, you have a good point. Just, well, different people made those different parts of the code so, better cygwin follow the ""convention"", if we can call it, that. :) On 8/14/2018 12:35 PM, Corinna Vinschen wrote: > printf ("nan (\"\") = %f\n", nan ("")); > printf ("-nan (\"\") = %f\n", -nan ("")); -- 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