Date: Thu, 28 Aug 1997 13:39:02 +0200 From: Hans-Bernhard Broeker Subject: Re: Floating Point Exception To: peter AT atmosp DOT physics DOT utoronto DOT ca (Peter Berdeklis) Cc: djgpp AT delorie DOT com Message-id: <01IMZ41113DK8WX7LN@mail> Organization: RWTH Aachen, III. physikalisches Institut B Content-transfer-encoding: 7BIT Newsgroups: comp.os.msdos.djgpp Precedence: bulk In article you wrote: > On 25 Aug 1997, Jos Bergervoet wrote: > > There is actually no need to prevent division by zero. It should > > produce Inf or Nan, and often your computation can go on and > > still deliver good results. > On an INTEL PC a divide by zero will cause a hardware exception that will > cause the processor to halt. It will return Inf or NaN only if you > install an exception handler that returns that value when the processor > flags the exception. I don't think you need an exception handler for that. Simply blocking that exception (see the _ctrl87 function for how to do that) will make the FPU generate Inf's and NaN's on its own. HBB