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:message-id:date:from:references:subject:to :content-type; q=dns; s=default; b=GlPr1ddKftuiYezpZUJiUydsdj+wR XlfuJVacjfdaKIVrji3u1vPs0myYofXTibbXczOql1R5I+yVVECrjtRO+j79GXI2 fANqg5goQEWOM/6YwZQD4aJnj7uJdIsWqG58iZaA6FlBGN+p+OVjIEXWbRQju/NC IK386I4q9gAW+Q= 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:message-id:date:from:references:subject:to :content-type; s=default; bh=ajxat7nIX6oIefbMO/EkEDOZbVg=; b=ECF CYvcLYgCmLknQ5sTVcKTJlckt87Xb8FK2M1emaP5+x4JDLeuc7H0NK5EWa5WUxnK nKkHPGrI07QI9V2+FeRcLRbHl1tGCb1i8JAYne3aAxvxxZEbtQ5O3FHSQZTq1a0C FWB44O8QZgx/D44FuMcxSL1GdxBpmbrLogVWPA0w= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=-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 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== Message-ID: <5b724bb4.1c69fb81.dd18a.e649@mx.google.com> Date: Mon, 13 Aug 2018 20:25:40 -0700 (PDT) From: Steven Penny References: <20180814 DOT 113135 DOT 1571893395887584078 DOT trueroad AT trueroad DOT jp> Subject: Re: strtod ("nan") returns negative NaN To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=utf8; format=flowed User-Agent: Tryst/2.8.0 (cup.github.io/tryst) 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