Mail Archives: djgpp-workers/1998/11/04/08:13:30
Subj: Re: Inlining math functions and ANSI/Posix
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
CC: djgpp-workers AT delorie DOT com
Dear Eli Zaretskii,
> This is all perfectly okay, except that if some of the exceptions are
> not masked, sqrt(-1) should trigger an FP exception and crash the
> program before all this cleverness has a chance to execute. v2.02
> startup code masks all exceptions, but what if an application unmasks
> some of them?
>
> Can you modify this program to unmask exceptions (by a call to
> `_control87') before the call to `sqrt', and see what happens?
>
Added _control87(0, 0x7777) before the call to `sqrt'.
As you suspected, the program crashes with a floating point exception
error.
> If it does crash, I wonder if we should do anything about it. At
> least some comment in the docs seems to be due.
Hmmm.
K.B. Williams
- Raw text -