www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/30/07:45:42

Date: Sun, 30 Nov 1997 14:43:11 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Josh Anderson <randerso AT win DOT bright DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: SIGFPE
In-Reply-To: <65qtun$1ml$1@reggie.win.bright.net>
Message-ID: <Pine.SUN.3.91.971130143928.5999C-100000@is>
MIME-Version: 1.0

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.). 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019