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:date:from:to:subject:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; q=dns; s=default; b=tfssFGRuI4nC9cEisIHG/W3YTp2TVR NmmZBhAAH8tMRI2YROhyAuqzE/UGjbLzET8ZUtt9m6kl5T/d/FdDJjGEEZ5fC4eA ZP6lhgb8srzBVucqv3uMhyrhMQToTqARJpXRppIq+z/vt5sX0dBObv7Fjgwg2Usx XKAzXFRegtrVo= 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:date:from:to:subject:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; s=default; bh=7dUOwFkRPfyevtSiJBb9/EkPvjY=; b=u4rt esexJO5haTlxvUWPF7l/by2Sphjr8/eUwLxrv6zcuKYeWi0VvqNBRLcufzlWFKtU IVOWXBVoOL7fonfgBBJVfeooI8fzJUpSoMhcaFmc+0ghIXBmiSB+FHforzOvX0cZ lj3B4pOolWDeieZatFjF+QD+i/i/2XrfwxoGkoM= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: <cygwin.cygwin.com> List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com> List-Archive: <http://sourceware.org/ml/cygwin/> List-Post: <mailto:cygwin AT cygwin DOT com> List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> 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-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 Date: Sun, 8 Apr 2018 13:11:48 +1000 From: Duncan Roe <duncan_roe AT optusnet DOT com DOT au> To: cygwin AT cygwin DOT com Subject: Re: Floating point exception in strtod() Message-ID: <20180408031147.GA3305@dimstar.local.net> Mail-Followup-To: cygwin AT cygwin DOT com References: <dd5e98ea-8f39-1c4b-116c-37968cb3a52d AT cornell DOT edu> <6e4ccba4-a74b-fb78-db0c-b8d1a2260658 AT cs DOT umass DOT 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 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 <stdio.h> > > #include <stdlib.h> > > #include <fenv.h> > > > > 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