Sender: nate AT cartsys DOT com Message-ID: <3766B1AB.AE8176B0@cartsys.com> Date: Tue, 15 Jun 1999 13:03:55 -0700 From: Nate Eldredge X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.10 i586) MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: FPE References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com 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