From owner-freebsd-hackers Thu Mar 4 14:39:33 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from cc942873-a.ewndsr1.nj.home.com (cc942873-a.ewndsr1.nj.home.com [24.2.89.207]) by hub.freebsd.org (Postfix) with ESMTP id 83C931504C for ; Thu, 4 Mar 1999 14:39:23 -0800 (PST) (envelope-from cjc@cc942873-a.ewndsr1.nj.home.com) Received: (from cjc@localhost) by cc942873-a.ewndsr1.nj.home.com (8.9.3/8.8.8) id RAA08114 for freebsd-hackers@freebsd.org; Thu, 4 Mar 1999 17:48:25 -0500 (EST) (envelope-from cjc) From: "Crist J. Clark" Message-Id: <199903042248.RAA08114@cc942873-a.ewndsr1.nj.home.com> Subject: FP Math Problem To: freebsd-hackers@freebsd.org Date: Thu, 4 Mar 1999 17:48:25 -0500 (EST) Reply-To: cjclark@home.com X-Mailer: ELM [version 2.4ME+ PL40 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I am trying to figure out why the following program produces a floating point exception and core dumps. #include #include #include int main() { double a = 1e200; double b; printf("fpgetmask: %o\n",fpgetmask()); printf("a: %e\n",a); b = a*a; printf("isinf: %d\n",isinf(b)); printf("isnan: %d\n",isnan(b)); printf("b > DBL_MAX: %d\n",b>DBL_MAX); printf("b: %e\n",b); return 0; } My output is, [112:~/tmp] ./dtest fpgetmask: 15 a: 1.000000e+200 isinf: 0 isnan: 0 Floating exception (core dumped) I started with this on -questions and (although the thread got sidetracked by a bad test program I presented at the beginning) other FreeBSDers have not reproduced the error, but get what I would expect, % ./dtest fpgetmask: 15 a: 1.000000e+200 isinf: 1 isnan: 0 b > DBL_MAX: 1 b: inf However, I get the FPE and core dump on my three FreeBSD machines (different hardware on each). All are, FreeBSD pc252.scitec.com 2.2.8-STABLE FreeBSD 2.2.8-STABLE #0: Mon Mar 1 14:25:39 EST 1999 Give or take a few days on the CVSup. (All were recently built to 2.2.8-S from 2.2.7-R.) It has been suggested I have somehow mucked up my floating point, but I do not know where to start and -questions did not produce many leads. Thanks for any help. More details can be provided; I would not know where to start. -- Crist J. Clark cjclark@home.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message