On 2002-10-14 at 19:48:23, Mark J. Reed wrote:
> Actually, 1/0 is not NaN; it's +Infinity.  You only get NaN out of
> dividing by 0 if the numerator is either infinite or also 0.
> The reason most implementations throw an error on division by 0
> is that they either don't have a representation for infinity 
> (not a problem in IEEE floating point) or the rest of the arithmetic
> operations don't behave sensibly when handed an infinite value.  

Well, let me backpedal a bit, here.

I realize the above is mathematically simplistic.  The
real reason y = x/0 returns an error is because no matter what
value you assign to y, you aren't going to get x back via multiplying
y by 0.  Certainly 0 times infinity is not going to give you back
your original numerator; the infinity value of x/0 is just a convention,
inspired by the fact that the *limit* of x/z as z approaches 0 is infinity.  

So it's probably a good idea when doing $y = $x/$z to notice that
$z is 0 before later trying to get $x back by multiplying $y * $z.

I suspect the erroneousness of division by 0 should be pragmatically
controlled.

--
Mark REED                    | CNN Internet Technology
1 CNN Center Rm SW0831G      | [EMAIL PROTECTED]
Atlanta, GA 30348      USA   | +1 404 827 4754 

Reply via email to