From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9960 invoked by alias); 14 Aug 2018 03:25:45 -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 9947 invoked by uid 89); 14 Aug 2018 03:25:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*M:1c69fb81, H*M:google X-HELO: mail-oi0-f49.google.com Received: from mail-oi0-f49.google.com (HELO mail-oi0-f49.google.com) (209.85.218.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 Aug 2018 03:25:43 +0000 Received: by mail-oi0-f49.google.com with SMTP id j205-v6so31124506oib.4 for ; Mon, 13 Aug 2018 20:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:references:subject:to:user-agent; bh=UPg1EwAL3TmC1ZYWu3OqFOpnhanVNRR0s+k1j/BBZd0=; b=VhzxRJAzmY6wtyq9zTOPSvc6IbtrZdkJHolKiAv5ljB+rYcEsNZnqSzOPAU+9MMvYq umpmQoF9sFuOerNZbuuKfwvzBOspHauev3a0G/EMpAZNiYMva9F12w7YOdLIwfLymBid iP+bV05e7JhMJruzf8nYDuNjpEueSxnE2emTLNr/YwiM8Ez688n7yM6XcKaD4qAHBSlz FYB4Q3345Jc+jrK5DdcUS7Oi4kaP0mregq7AUszx2InN7sZeQOzvMV3hMjxTeJOxz/PK EdUI8JPk3xE7goeAp+yQxcRWuGku/eXDD1QGkPHzUpTuNW47RyD8zR1aT10KFcXqUGQH TYBQ== Return-Path: Received: from rnj ([2605:6000:9fc0:56:cc81:ec52:ab35:2fe4]) by smtp.gmail.com with ESMTPSA id e204-v6sm31177527oif.21.2018.08.13.20.25.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Aug 2018 20:25:40 -0700 (PDT) Message-ID: <5b724bb4.1c69fb81.dd18a.e649@mx.google.com> Date: Tue, 14 Aug 2018 03:25:00 -0000 From: Steven Penny References: <20180814.113135.1571893395887584078.trueroad@trueroad.jp> Subject: Re: strtod ("nan") returns negative NaN To: cygwin@cygwin.com Content-Type: text/plain; charset=utf8; format=flowed User-Agent: Tryst/2.8.0 (cup.github.io/tryst) X-SW-Source: 2018-08/txt/msg00162.txt.bz2 On Tue, 14 Aug 2018 11:31:35, Masamichi Hosoda wrote: > If I understand correctly, > `std::stod ()` uses cygwin1.dll's `strtod ()` for the conversion. > > `std::stod ()` is defined in > /usr/lib/gcc/x86_64-pc-cygwin/7.3.0/include/c++/bits/basic_string.h L6388-. > It calls `__gnu_cxx::__stoa ()` with pointer of `std::strtod ()`. > > ``` > inline double > stod(const string& __str, size_t* __idx = 0) > { return __gnu_cxx::__stoa(&std::strtod, "stod", __str.c_str(), __idx); } > ``` > > `__gnu_cxx::__stoa ()` is defined in > /usr/lib/gcc/x86_64-pc-cygwin/7.3.0/include/c++/ext/string_conversions.h L51-. > It calls the first parameter, `std::strtod ()`. > > `std::strtod ()` is cygwin1.dll's `strtod ()`. Ah, so thats why this is happening: $ awk 'BEGIN {print +"nan"}' -nan > the numeric value of the *numeric string* shall be the value that would be > returned by the strtod() call http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html#tag_20_06_13_02 -- 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