Mail Archives: djgpp/1999/06/15/16:16:14
Eli Zaretskii wrote:
>
> On Mon, 14 Jun 1999, Justin Deltener wrote:
>
> > I always thought if I get a Floating Point Exception it was because I
> > was dividing by 0!? My program is getting weird FPE's so I made a test
> > program to divide a float by 0, and divide 0.0 by a float. Both gave
> > answers WITHOUT generating an FPE, soooooo, that kinda shoots that
> > theory out the window...
>
> Floating point exception that is caused by division by zero is masked
> in DJGPP. A masked exception prevents SIGFPE from being delivered to
> your program, and instead causes the FPU to return an Infinity as the
> result. (Try printing the result of division by zero, and you will
> see "Inf" instead of a number.)
Note also that integer division by zero is not handled by the FPU and so
cannot be masked. This will still signal SIGFPE. (Admittedly
confusing, as it isn't floating point, but it's the closest signal.)
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -