[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CLTL compatible type contagion?
- To: clisp-list@ma2s2.mathematik.uni-karlsruhe.de
- Subject: Re: CLTL compatible type contagion?
- From: rls@therat.math.waikato.ac.nz (Richard Shepherd)
- Date: Mon, 7 Aug 1995 10:08:54 +1200 (NZST)
- In-reply-to: <199508061909.PAA20531@screamer.rtp.ericsson.se> from "Raymond Toy" at Aug 6, 95 09:18:02 pm
Raymond Toy wrote:
> However, I was doing some numerical prototyping with clisp and came
> across this very annoying problem with the current type contagion:
>
> (+ 1d50 1.0)
>
> does not return 1d50. Instead, it signals a floating-point overflow.
> I presume that clisp does the addition in double-float and then
> coerces the result to single-float, causing the overflow.
>
> This behavior makes numerical work more difficult than it
> should be.
This is weird to me because:
(+ 1d50 1)
-> 1.0d50
and
(+ 1d50 1d0)
-> 1.0d50
but as pointed out, adding 1.0 or 1e0 causes the overflow error. Is
this consistent?
8<--------------------------->8
Richard Shepherd.
(rls@therat.math.waikato.ac.nz)
WWW home page:- http://therat.math.waikato.ac.nz/