Front page | perl.perl6.language | Postings from October 2002

## Re: Indeterminate math

From:
Trey Harris
Date:
October 15, 2002 08:40
Subject:
Re: Indeterminate math
Message ID:
Pine.BSF.4.44.0210151126230.87017-100000@bowser.eecs.harvard.edu
In a message dated Tue, 15 Oct 2002, Angel Faus writes:

>
> > Mathematically, 1/0 is not +Infinity.  It's undefined/indeterminate
> > in the set of rational numbers.  The IEEE may say otherwise.
>
> Mathematically, 1/0 is whatever you define it to be.

Well, sure.  That's as axiomatic as saying, "mathematically, the number
one is whatever you define it to be."  But a mathematical system that has
a definition which is inconsistent with the rest of the system is a flawed
one.  If you let 1/0 be *anything*, then ordinary algebraic logic falls
apart.  Those silly proofs where it is "proven" that 1 = 2, 1 + 1 = 1,
etc., all depend on division by zero being possible (regardless of what
its value is).  You have to keep division by zero illegal to avoid these
absurd results.  Hence, to my mind at least, exception-throwing or NaN is
a better solution than infinity.

But will it really matter one way or the other?  Probably not, so we
should stop quibbling.  Perhaps if someone could demonstrate a real-world
need for either NaN or infinity in this case, or else a case for why
exception-throwing should *not* go away, we'd be able to bring the
discussion somewhere more fruitful.

For my part: division by zero is so often a programmer error, and so
rarely a useful thing to do, that it seems to me that exception-throwing
should remain the behavior in Perl 6.

Trey

nntp.perl.org: Perl Programming lists via nntp and http.