Re: Floating-point arithmetic in CL
From: Pascal Bourguignon (spam_at_mouse-potato.com)
Date: 12/02/04
- Next message: Tim Bradshaw: "Re: How to survive using a non Lisp language?"
- Previous message: Alain Picard: "Re: How to survive using a non Lisp language?"
- In reply to: Cameron MacKinnon: "Re: Floating-point arithmetic in CL"
- Next in thread: Joseph Oswald: "Re: Floating-point arithmetic in CL"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Next message: Tim Bradshaw: "Re: How to survive using a non Lisp language?"
- Previous message: Alain Picard: "Re: How to survive using a non Lisp language?"
- In reply to: Cameron MacKinnon: "Re: Floating-point arithmetic in CL"
- Next in thread: Joseph Oswald: "Re: Floating-point arithmetic in CL"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|