Re: Floating-point arithmetic in CL

From: William D Clinger (cesuraSPAM_at_verizon.net)
Date: 12/03/04


Date: 3 Dec 2004 12:54:54 -0800

David Steuber <david@david-steuber.com> wrote:
> > Ah, but one can still do exact arithmetic on algebraic numbers. Of
> > course, they are still only a countable family.
>
> I'm probably getting in over my head here, but how does this work? I
> guess the most common example of an algebraic irratinal number would
> be (sqrt 2). Wouldn't you have to leave it in the form (sqrt 2) to do
> exact arithmetic? Once evaluated, you loose something.

(sqrt 2) would evaluate to some exact representation of the
square root of 2. Although the list (sqrt 2) is one possible
representation, it isn't the only one.

The algebraic numbers are closed under addition, subtraction,
multiplication, and division, so we really can do exact arithmetic
on them.

> I also didn't know the set of algebraic numbers had cardinality.

If you believe in the axiom of choice, and in any of the usual
formalizations of set theory, then your beliefs imply that every
set has a cardinality. (I don't believe in the axiom of choice
myself, but I know a lot of people who say they do.)

> I
> thought it was more like the set of transcendental numbers or reals in
> general. I don't know if I could follow a proof that the set of
> algebraic numbers is countable, but you are welcome to post one.

An algebraic number is a root of a polynomial with rational
coefficients. There are only a countable number of polynomials
with rational coefficients, and each of those polynomials has
only a finite number of roots (bounded by the degree of the
polynomial). Hence there are at most countably many algebraic
numbers.

It might be fun to talk about floating-point arithmetic in CL,
but I think Cameron needs to figure out whether he wants CL to
be a tool for educated programmers or a calculator for teenagers.
:)

Will



Relevant Pages