Re: Floating-point arithmetic in CL

From: Pascal Bourguignon (spam_at_mouse-potato.com)
Date: 12/02/04


Date: 02 Dec 2004 11:51:59 +0100

Cameron MacKinnon <cmackin+nn@clearspot.net> writes:

> John Thingstad wrote:
> > But if you want to understand the undelying principles you will sooner
> > or later have to relate to the fact that computers have finite precision.
>
> Show me an example of a newbie's post that required infinite
> precision. There is no underlying "principle" of CS that says
> computers can't add, and if young students can be taught how to
> subtract 0.11111... from 0.99999... without using an infinite number
> of pencils, I see no reason why it would require an infinite number of
> electrons.

No, but try this rather: 3.14159265..... - 0.11111111.... = ?
without an infinite number of pencils.

> This is all true as far as it goes (though some of these things look
> suspiciously easy to automate), but it misses my point: The VAST
> majority of newbies aren't caught out by precision issues while
> performing long chains of sophisticated numerics, nor will they ever
> in their programming careers work on such problems. They're doing a
> small number of operations (in the OP's case, *one*) on numbers with
> few significant digits (in the OP's case, *one*) and an exponent close
> to zero. Their computers are spending 95% of CPU driving the GUI, and
> there is no good reason why their expectation of accurate answers
> can't be fulfilled.

Why do you think lisp invented rational numbers?
Try: (- 1 1/9) instead of 0.9999999... - 0.1111111....

This is still a problem of teaching users to use 1/9 instead of
0.11111 and 4/10 instead of 0.4!

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
The world will now reboot; don't bother saving your artefacts.


Relevant Pages

  • errors of Dubuques & Davidsons attempts; #124; 2nd ed; Euclids IP proof
    ... for if both Davidson above and Dubuque below ... A contradiction does work if it follows from previous ... THEOREM There are infinite number of primes. ... 2,3,5,7,11, ..,p_n possessing a cardinality n Reason: ...
    (sci.math)
  • Re: OT: Ive had it with Windows - got Linux working
    ... They're better than they used to be, but there's no reason why computers should only be easy to use for experienced users. ... What's unique about operating systems and software in general is that the OS is a common denominator. ...
    (alt.guitar.bass)
  • Re: Humble pie.
    ... >> uncountability of certain sets. ... >> The second reason springs directly from the first, in that, according to ... the set of natural numbers has an order of infinite ... Speaking purely from the standpoint of cardinality, ...
    (sci.logic)
  • OT: The Ass Of God was Re: OT: Desk Attack
    ... Well, infinite ... But Rich, don't you see ... > doing LSD some decades ago partly for that reason). ... Just like any subpart of a larger whole, its subjective reality is ...
    (sci.electronics.design)
  • Re: Set Theory: Should You Believe
    ... there is such a thing as an infinite tape, ... existence of an infinite tape is no different from assuming that people ... infinite memory computers cannot really be built. ... In practice, no brute force method is remotely practical. ...
    (sci.logic)