Mail Archives: djgpp/2000/02/11/07:14:46
djgpp AT delorie DOT com (Peter Restall) wrote in
<200002101809 DOT SAA01894 AT burdock DOT restall DOT net>:
> if (c != 0.0)
> {
> temp = 1.0 / c;
The last statement may overflow (to Infinity), and thus may cause
a floating point exception, i.e when c is a subnormal/denormal
number. This might cause your problem. (I think it is very
unfortunate, that this often used idom - divide only when the
divisor != 0 - can fail, but it really can fail, in the sense that
the result will be an unexpected Infinity, that may trigger an
exception.) You should compile your program with debugging information
(-g) and execute it with fsdb. Set a breakpoint at the start of
this offending function, and single step through the function,
while looking at the NPX pane. This should give you some hints.
Regards,
Dieter
- Raw text -