From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97337 invoked by alias); 8 Apr 2018 03:12:09 -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 97213 invoked by uid 89); 8 Apr 2018 03:11:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=Hx-languages-length:1077, H*F:D*com.au, HContent-Transfer-Encoding:8bit X-HELO: mail108.syd.optusnet.com.au Received: from mail108.syd.optusnet.com.au (HELO mail108.syd.optusnet.com.au) (211.29.132.59) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 08 Apr 2018 03:11:52 +0000 Received: from dimstar.local.net (unknown [210.49.74.88]) by mail108.syd.optusnet.com.au (Postfix) with SMTP id 928AA1A338D for ; Sun, 8 Apr 2018 13:11:49 +1000 (AEST) Received: (qmail 3555 invoked by uid 501); 8 Apr 2018 03:11:48 -0000 Date: Sun, 08 Apr 2018 03:12:00 -0000 From: Duncan Roe To: cygwin@cygwin.com Subject: Re: Floating point exception in strtod() Message-ID: <20180408031147.GA3305@dimstar.local.net> Mail-Followup-To: cygwin@cygwin.com References: <6e4ccba4-a74b-fb78-db0c-b8d1a2260658@cs.umass.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6e4ccba4-a74b-fb78-db0c-b8d1a2260658@cs.umass.edu> User-Agent: Mutt/1.6.1 (2016-04-27) X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=DRuhS6OGlO/VPiI5KpoYuA==:117 a=DRuhS6OGlO/VPiI5KpoYuA==:17 a=8nJEP1OIZ-IA:10 a=Kd1tUaAdevIA:10 a=cbQx-rGyNjT56se0aiUA:9 a=bza6o_CgRQHMTtx_:21 a=Daeat6-43Kn2kLPS:21 a=wPNLvfGTeEIA:10 X-IsSubscribed: yes X-SW-Source: 2018-04/txt/msg00059.txt.bz2 On Sat, Apr 07, 2018 at 04:56:13PM -0400, Eliot Moss wrote: > 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 > I tried in 64-bit with the same result as Eliot: works fine w/out feenableexcept, no o/p with feenableexcept. Cheers ... Duncan. -- 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