Mail Archives: djgpp/1997/03/04/07:01:16
On Mon, 3 Mar 1997, Ove Kaaven wrote:
> [some irrelevant selectors]
Bad judgement, IMHO. You should never omit parts of the traceback,
because they might give people here vital clues about the true nature
of your problem.
> I realize that this is probably a floating-point overflow, but is
> there a good way around it?
I suggest you first verify that the problem is indeed an overflow (it
might be some other FP-related trouble, like passing an invalid
argument to a math function). Once you did that, there are three ways
around this that I can think of:
1) Include run-time tests in your program that would prevent
the FP error from happening in the first place (once you understand
what exactly causes it to bomb, this should be easy).
2) Cause your program to ignore FP exceptions by including the
following somewhere at its beginning:
#include <signal.h>
...
signal (SIGFPE, SIG_IGN);
3) Use the `_control87' library function to mask off some (or
all) of the causes for FP exceptions.
> 4. Where should I post this to keep it from being off-topic?
This is perfectly on-topic for this news group.
- Raw text -