delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/28/07:39:49

Date: Thu, 28 Aug 1997 13:39:02 +0200
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
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
Newsgroups: comp.os.msdos.djgpp

In article <Pine DOT SGI DOT 3 DOT 91 DOT 970827172731 DOT 22048A-100000 AT atmosp DOT physics DOT utoronto DOT ca> 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019