X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=0.8 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,REPTO_QUOTE_YAHOO,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org X-Rocket-MIMEInfo: 001.001,VGhlIGZvbGxvd2luZyBjb2RlIGRlbW9uc3RyYXRlcyBhIHN1YnRsZSBidWcgaW4gdGhlIEN5Z3dpbiB2ZXJzaW9uIG9mIHN0cnRvZCgpLiBUaGUgdmFsdWUgaXQgZ2VuZXJhdGVzIGlzIHNsaWdodGx5IGRpZmZlcmVudCB0aGFuIHRoZSB2YWx1ZSB3aGVuIHVzaW5nIHRoZSBtYXRoIGhlYWRlciBmaWxlcy4gVGhpcyB1c2VkIHRvIHdvcmsgY29ycmVjdGx5IHNvbWUgdGltZSBhZ28gKG1vbnRocykuIEkganVzdCB0b29rIHRoZSB0aW1lIHRvIHRyYWNrIHRoZSBwcm9ibGVtIGRvd24gaW4gb3VyIHJlZ3Jlc3Npb24BMAEBAQE- Message-ID: <1355878473.91036.YahooMailNeo@web121001.mail.ne1.yahoo.com> Date: Tue, 18 Dec 2012 16:54:33 -0800 (PST) From: "Cary R." Reply-To: "Cary R." Subject: Bug in Cygwin strtod() To: "cygwin AT cygwin DOT com" MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 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 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id qBJ0vRsM005967 The following code demonstrates a subtle bug in the Cygwin version of strtod(). The value it generates is slightly different than the value when using the math header files. This used to work correctly some time ago (months). I just took the time to track the problem down in our regression suite. #include #include #include int main() {     double value = M_LN10;     printf("generate const. - value: %0.15f.\n", value);     printf("expected const. - value: 2.302585092994046.\n");     printf("\n");     value = strtod("2.30258509299404568402", 0);     /* Note: the last digit is incorrect. */     printf("generate strtod - value: %0.15f.\n", value);     printf("expected strtod - value: 2.302585092994046.\n");     return 0; } This code does produce the expected output under Linux and when using the MinGW compilers. Cary -- 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