Mail Archives: djgpp/1996/03/03/14:31:40
On Sat, 2 Mar 1996, Stephen L Moshier wrote:
> The answer should be i = infinity.
> Compiled with DJGPP V2, the program crashes with a floating point exception.
> Why? Because the coprocessor is set to trap on divide by zero!
>
> With no IEEE flags support system (or did I miss seeing it?) and the
> coprocessor set wrong, it seems impossible that the library could have
> been tested properly. One does not have to investigate further to
> surmise that the library is very likely junk. Writing a free IEEE
There is a library function called _control87 which can be used to put the
coprocessor in a state that doesn't cause FP exception. As far as I know,
if you mask the zero-divide exception, the coprocessor should return Inf.
Can you please look at that function (and maybe even try using it with the
library) and tell if the program you posted in particular, and the libm.a
library in general, can be made work? Maybe there is something useful to
do with that library except tossing it altogether, after all?
- Raw text -