Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Apr 2000 09:34:34 +1000
From:      "Andrew Reilly" <areilly@nsw.bigpond.net.au>
To:        Dan Nelson <dnelson@emsphone.com>
Cc:        Sheldon Hearn <sheldonh@uunet.co.za>, Brooks Davis <brooks@one-eyed-alien.net>, Nate Lawson <nate@elite.net>, freebsd-hackers@FreeBSD.ORG, freebsd-ports@FreeBSD.ORG, davidm@hpl.hp.com
Subject:   Re: floating point exceptions
Message-ID:  <20000427093434.A81401@gurney.reilly.home>
In-Reply-To: <20000426110345.A13173@dan.emsphone.com>
References:  <20000425000523.A17224@orion.ac.hmc.edu> <24238.956752200@axl.ops.uunet.co.za> <20000426110345.A13173@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Apr 26, 2000 at 11:03:45AM -0500, Dan Nelson wrote:
> In the last episode (Apr 26), Sheldon Hearn said:
> > On Tue, 25 Apr 2000 00:05:23 MST, Brooks Davis wrote:
> > > > Is FreeBSD's behavior correct?  Why or why not?  You can use the
> > > > included code snippet to verify that this occurs.
> > > 
> > > FreeBSD has traditionaly violated the IEEE FP standard in this
> > > regard. This is fixed in 5.0 and I think in 4.0-STABLE (though I
> > > can't remember what file this is in so I can't check.)
> > 
> > Huh?  I'm pretty sure you've got this backwards.  FreeBSD has
> > traditionally upheld the standard and we only recently decided to go
> > with the flow in 5.0.
> 
> No; we held our moral ground against IEEE, until 5.0 when we gave in. 
> The IEEE standard says "trap nothing".  For most programs, this is the
> wrong thing to do, since they are not signal-processing apps or
> numerical analysis programs and a divide by zero is a coding error. 
> I'd rather have my program die on an unexpected divide by zero than
> continue with invalid data.
> 
> Why should we treat (1.0/0.0) any differently from (1/0)?

Because 0.0 might be the closest approximation to whatever
number you were really trying to divide by that the hardware can
manage.  0 is never an approximation to 1 or -1.

Dividing is for wimps, anyway.    :-)

-- 
Andrew


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000427093434.A81401>