Date: Sun, 30 Nov 1997 14:43:11 +0200 (IST) From: Eli Zaretskii To: Josh Anderson cc: djgpp AT delorie DOT com Subject: Re: SIGFPE In-Reply-To: <65qtun$1ml$1@reggie.win.bright.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Sat, 29 Nov 1997, Josh Anderson wrote: > I have a simple question. What causes a SIGFPE error. I know that a > division by zero does, but sometimes my progs SIGFPE when I *know* there > isn't a divide by zero. Any invalid FP operation, such as sqrt or log of a negative number, will trigger SIGFPE. > Also, I once remember seeing code that would > disable the SIGFPE, but I don't remember where. Does anyone know how to do > that? Use the library function `_controll87' to mask off the invalid operation exception (the rest are already masked by the DJGPP startup code). If you do that, your code should be prepared to handle special results generated by x87 in the cases that would have generated the exception (NaN, Infinity, etc.).