[Ecls-list] wrong value for (float-sign -0.0)

Robert Dodier robert.dodier at gmail.com
Sat Oct 4 19:13:10 UTC 2008


On Sun, Sep 28, 2008 at 7:22 AM, Waldek Hebisch
<hebisch at math.uni.wroc.pl> wrote:

> It seems that ECL does not support -0.0 (at least on input), which
> is pretty reasonable thing for Lisp to do:
>
>> (eq 0.0 -0.0)
> T

FWIW the CL spec
(http://www.lispworks.com/documentation/HyperSpec/Body/t_float.htm)
has something to say about signed zero.

"In addition, there is a floating-point zero; depending on the implementation,
there can also be a ``minus zero''. If there is no minus zero, then 0.0 and -0.0
are both interpreted as simply a floating-point zero. (= 0.0 -0.0) is
always true.
If there is a minus zero, (eql -0.0 0.0) is false, otherwise it is true."

> So, the correct value is 1.0.  Another thing is :IEEE-FLOATING-POINT
> in the features: I personally would sugesst to have feature called
> :IEEE-ROUNDING (or maybe :IEEE-FLATING-FORMAT) to indicate that IEEE
> rounding and representation is used.  I believe that most people
> when they say that thay want IEEE really want standard format and
> rounding rules while other parts starting from signed 0 (especially
> Nans and denormals) are pretty controversial.

Yeah. :IEEE-FLOATING-POINT should be present only if the implementation
supports all of IEEE 754. If it supports a proper subset then the features
list should be changed accordingly. Maybe each feature (representation,
rounding, signed zero, infinity, not-a-number, denormalized numbers, any
others) should have its own feature keyword.

>From the definition of a float number in the CL spec, I have concluded
that IEEE 754 floating point infinity and not-a-number are excluded;
from what I can tell, a conforming CL implementation cannot have float
numbers which are infinity or not-a-number. That's unfortunate but it
seems clear enough from the definition of a float number in the
aforementioned section of the spec.

I'm not sure whether the CL definition of floats allows or rules out
denormalized
numbers. Maybe someone whose mojo is stronger can answer.

FWIW

Robert Dodier




More information about the ecl-devel mailing list