[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CLTL compatible type contagion?
- To: clisp-list <clisp-list@ma2s2.mathematik.uni-karlsruhe.de>
- Subject: Re: CLTL compatible type contagion?
- From: Raymond Toy <toy@rtp.ericsson.se>
- Date: Mon, 07 Aug 1995 15:10:09 -0400
- In-reply-to: (Your message of Mon, 07 Aug 1995 20:01:41 +0200.) <9508071711.AA05660@ilog.ilog.fr>
Bruno> (+ 1d40 1e37)
Bruno> Returning 1.001d40 for this would be wrong (IMO) since the two numbers,
Bruno> considered as intervals, add up like this:
Bruno> 1d40 +/- 1e24
Bruno> 1e37 +/- 1e29
Bruno> =================
Bruno> 1.001d40 +/- 1e29
This is a nice example of why the answer should be a single-float.
But what about this example?
1.000001 +/- 1e-8
- 1.000000 +/- 1e-8
===================
0.000001 +/- 2e-8
What should the type of the result be? Something less than a
short-float? The current scheme seems like a half-attempt at interval
arithmetic. Either go all the way or don't go at all.
Ray
P.S. If I sound harsh or antagonistic, I'm not. I'm just really
curious about how clisp does it's arithmetic and the reasoning behind
it. I have found that clisp is at least as good as gcl and cmulisp
(the only lisp implementations I used) in speed and executable size
for general purpose prototyping. Clisp only loses when I do
heavy-duty floating point operations, and, then, only if I'm very
careful to declare everything correctly.