From owner-freebsd-questions Tue Aug 18 11:10:17 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA01184 for freebsd-questions-outgoing; Tue, 18 Aug 1998 11:10:17 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from cyclone.degnet.baynet.de (cyclone.degnet.baynet.de [194.95.214.129]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id LAA01114 for ; Tue, 18 Aug 1998 11:10:06 -0700 (PDT) (envelope-from malte.lance@gmx.net) Received: from neuron.webmore.de (unverified [194.95.214.171]) by cyclone.degnet.baynet.de (EMWAC SMTPRS 0.83) with SMTP id ; Tue, 18 Aug 1998 20:10:32 +0200 Received: (from malte.lance@gmx.net) by neuron.webmore.de (8.8.8/8.8.8) id SAA04090; Tue, 18 Aug 1998 18:37:45 +0200 (CEST) From: Malte Lance MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 18 Aug 1998 18:37:44 +0200 (CEST) To: "Brian C. Grayson" Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Avoiding SIGFPE In-Reply-To: <19980817170029.A4330@marvin.ece.utexas.edu> References: <19980817170029.A4330@marvin.ece.utexas.edu> X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <13785.44402.698110.760908@neuron.webmore.de> Reply-To: malte.lance@gmx.net Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Brian C. Grayson writes: > Under NetBSD, 1.0/0.0 returns NaN. Under FreeBSD, it causes an > exception. I could have sworn there was some way to specify > which behavior one wanted, but I can't find it anywhere. Is > there any way in FreeBSD to say ``just return NaN'', or will it > always SIGFPE me? Or, is there any way to write a signal handler > that will catch the SIGFPE, and tell it to just use a value of > NaN, and resume execution? I'm already trapping signals and > installing signal handlers in this app, so installing another > one would be No Big Deal. Then take the signal-handler-approach and have a look at: FPGETROUND(3) FreeBSD Library Functions Manual FPGETROUND(3) NAME fpgetround, fpsetround, fpsetprec, fpgetprec, fpgetmask, fpsetmask, fpgetsticky, fpresetsticky - IEEE floating point interface Malte. > > TIA. > Brian > -- > "...and the particle undergoes a BOINNNNG..." - Dr. Dunning, PHYS 202 > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message