Re: Possreps and numeric types

From: Matthias Klaey <mpky_at_hotmail.com>
Date: Tue, 27 Mar 2007 03:46:34 +0200
Message-ID: <gqsg031cmfnr5p5fbiokksmaf8psios4hh_at_4ax.com>


"Marshall" <marshall.spight_at_gmail.com> wrote:

>On Mar 26, 2:39 am, "David Cressey" <cresse..._at_verizon.net> wrote:
>> "Marshall" <marshall.spi..._at_gmail.com> wrote in message
>>
>> If the representation scheme for integers is indefinitely extensible, then
>> the field of rationals representable is likewise indefinitely representable.
>> Common decimal notation of integers is indefinitely extensible. There are
>> other schemes.
>
>Right.
>
>
>> In any finite computer, it is only possible to actually represent a finite
>> subset of the integers, and thus it is only possible to represent exactly a
>> finite subset of the rationals. The problem is that the finite subset of
>> rationals will not, in general, exhibit closure under addition. Thus one is
>> forced into the realm of approximation as soon as one begins to store the
>> results of arithmetic computation.
>
>Well, again I object to the word "approximation." The result of a
>rational addition will either be an exact correct answer or a
>failure due to hitting a resource limitation. I would *not* call
>that an approximation.
>
>
>Marshall

I used to teach that if you calculate "2 + 2" on a computer, the result would be somewhere between 3 and 5, and you could not tell what it is *exactly*, but it would be *exactly* the same number how many times you repeated the calculation.

Thus: no, there is no *approximation* in the *operators*, or to be more precise, the algorithms that implement the high level "+" and other arithmeic operations. There is a problem in the range of inputs these algorithms can deal with: They cannot return the exact result in almost all cases (meaning, in all cases except a finite number). This is a fundamental limit of all finite computers.

To think that 2+2 sometimes returns 3.9, other times 4.1, is ... well, just not the way machines work.

Greetings
Matthias Kläy

-- 
www.kcc.ch
Received on Tue Mar 27 2007 - 03:46:34 CEST

Original text of this message