Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: billm@melbpc.org.au (Bill Metzenthen)
Subject: Re: division by zero exceptions ?
Date: 1998/11/01	[thread overview]
Message-ID: <slrn73ofkl.hmt.billm@lorentz.melbpc.org.au> (raw)
In-Reply-To: t7L$feAI$3O2EwGI@thewolery.demon.co.uk

On Sat, 31 Oct 1998 21:23:20 +0000, Anthony W. Youngman
  <thewolery@nospam.demon.co.uk> wrote:

>See my other post - if I'm doing math, I WANT it to return the correct
>value, ie if I say "x = y / tan( pi / 2)" then I WANT x to be set to
>infinity. If I don't have to trap for divide by zero, then my thousand
>lines becomes five hundred, and it's a damn sight easier to debug.
>
>Look at it as a mathematician, not an engineer. x divided by 0 IS
>infinity, and I wish computers could cope with that fact, and not crash
>my program.

Hang on a moment, what do you mean by infinity?  In the type of
mathematics which most people would like to approximate with
floating point mathematics, there is no such thing as infinity:
x/0 is not a legal operation!

I was interested to see your example where this fictitious object can
be useful.  Part of my background is in electrical engineering where
having infinity can be useful e.g. when computing the impedance of
parallel circuit branches when one of the branches is a short circuit.
I thought that this was one of the few cases where the 1/0 = infinity
behaviour was useful; your example adds one more to my list (1).

For most computations 1/0 represents a severe error which should be
dealt with as soon as it occurs.

(1) Note that in both cases, I would argue that it is really a
projective infinity which is being used.  Really old Intel FPU's used
to support these but now they only support affine infinities.

-- 
-----------------------------------------------------------------------------
Bill Metzenthen        | See http://www.suburbia.net/~billm/ for information
billm@melbpc.org.au    | on an 80x87 FPU emulator, using floating point
billm@suburbia.net     | (particularly on Linux), and code for manipulating
Melbourne, Australia   | the floating point environment on 80x86 Linux.
-----------------------------------------------------------------------------



  reply	other threads:[~1998-11-01  5:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-26  5:00 division by zero exceptions ? Conrad Sanderson
1998-10-26  5:00 ` Michal Jaegermann
1998-10-27  5:00 ` Remco Wouts
1998-10-28  5:00   ` Nils Faerber
1998-10-31  5:00 ` Shana Tackett
1998-10-30  5:00   ` James D. Freels
1998-10-31  5:00     ` Toon Moene
1998-10-31  5:00       ` Anthony W. Youngman
1998-11-01  5:00         ` Bill Metzenthen [this message]
1998-11-01  5:00           ` Anthony W. Youngman
1998-11-02  5:00             ` Bill Metzenthen
1998-11-02  5:00               ` Conrad Sanderson
1998-11-02  5:00             ` Stefan Davids
1998-11-01  5:00         ` Stefan Davids
1998-11-02  5:00         ` Michal Jaegermann
1998-10-31  5:00     ` Greg Lindahl
1998-11-03  5:00     ` rscanon
1998-10-31  5:00   ` Anthony W. Youngman
1998-11-01  5:00     ` Greg Lindahl
1998-10-31  5:00   ` Bill Metzenthen
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox