Date: Tue, 18 Aug 1998 18:37:44 +0200 (CEST) From: Malte Lance <malte.lance@gmx.net> To: "Brian C. Grayson" <bgrayson@marvin.ece.utexas.edu> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Avoiding SIGFPE Message-ID: <13785.44402.698110.760908@neuron.webmore.de> In-Reply-To: <19980817170029.A4330@marvin.ece.utexas.edu> References: <19980817170029.A4330@marvin.ece.utexas.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?13785.44402.698110.760908>