[Ecls-list] Lots of regressions due to -0.0

Raymond Toy toy.raymond at gmail.com
Sat Oct 4 23:00:21 UTC 2008


Juan Jose Garcia-Ripoll wrote:
> On Sun, Oct 5, 2008 at 12:42 AM, Raymond Toy <toy.raymond at gmail.com> wrote:
>   
>> I don't know what the hash cache is, but I think ANSI CL says -0 and 0
>> should hash the same.  The easy way to make that happen is to add 0 to
>> the number to be hashed.
>>     
>
> ECL keeps a cache of the output produced by subtypep. Until now this
> cache was implemented using a vector that was indexed by the hash key
> of the input type. The problem is that (DOUBLE-FLOAT -0.0 *) and
> (DOUBLE-FLOAT 0.0 *) are different intervals, but according to CL they
>   
Actually, I had the same question about those CL declarations.  It's
somewhere on comp.lang.lisp, sometime in the 90s somewhere.

Th conclusion was that they are the same interval.  If you really want
(double-float -0d0 *), you have to write
(or (double-float (0d0) *) (member -0d0)).  For (double-float 0d0 *),
you have to write (or (double-float (0d0) *)  (member 0d0))

For a while, cmucl treated them as different because it made type
derivation much, much simpler.  But cmucl doesn't do that anymore.

Ray





More information about the ecl-devel mailing list