From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127502 invoked by alias); 7 Apr 2018 20:56:17 -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 127492 invoked by uid 89); 7 Apr 2018 20:56:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: mailsrv.cs.umass.edu Received: from mailsrv.cs.umass.edu (HELO mailsrv.cs.umass.edu) (128.119.240.136) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 07 Apr 2018 20:56:15 +0000 Received: from [192.168.0.3] (c-24-62-203-86.hsd1.ma.comcast.net [24.62.203.86]) by mailsrv.cs.umass.edu (Postfix) with ESMTPSA id D665C401F5FE; Sat, 7 Apr 2018 16:56:13 -0400 (EDT) Reply-To: moss@cs.umass.edu Subject: Re: Floating point exception in strtod() To: cygwin@cygwin.com References: From: Eliot Moss Message-ID: <6e4ccba4-a74b-fb78-db0c-b8d1a2260658@cs.umass.edu> Date: Sat, 07 Apr 2018 20:56:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-04/txt/msg00057.txt.bz2 On 4/7/2018 1:40 PM, Ken Brown wrote: > $ cat strtod_test.c > #include > #include > #include > > int > main () > { >   /* The following number comes from /usr/share/asymptote/ode.asy.  */ >   const char *str = "121645100408832000.0"; >   char *ptr; > >   feenableexcept (FE_INVALID); >   strtod (str, &ptr); > >   /* If there was an exception, the following will not get executed.  */ >   printf ("No exception.\n"); > } If I do the same thing WITHOUT the feenableexcept, it works fine. Perhaps strtod catches an exception and then applies a different method in some cases, or perhaps it wants exceptions off and deals with things its own way. If I include the feenableexcept, I get the same behavior you reported (in 32-bit; I did not test 64-bit). Regards - Eliot Moss -- 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