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

Gabriel Dos Reis gdr at integrable-solutions.net
Sat Oct 4 21:17:26 UTC 2008


On Sun, Sep 28, 2008 at 8:22 AM, Waldek Hebisch
<hebisch at math.uni.wroc.pl> wrote:
> Gabriel Dos Reis wrote:
>>
>> Hi Juanjo,
>>
>>   ECL reports wrong value for the sign of -0.0.
>>
>>   > *features*
>>   (:LINUX :FORMATTER :IEEE-FLOATING-POINT :RELATIVE-PACKAGE-NAMES :DFFI
>>    :CLOS-STREAMS :CMU-FORMAT :UNIX :ECL-PDE :DLOPEN :CLOS :BOEHM-GC :ANSI-CL
>>    :COMMON-LISP :ECL :COMMON :PENTIUM3 :FFI :PREFIXED-API)
>>   > (float-sign -0.0)
>>   0.0
>>
>>
>> The correct value is -1.0.
>>
>
> 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
>
> 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.

Most of the people interested in IEEE 754 are largely uninterested in
the format in itself.  The IEEE 754 format is a *logical*, NOT a
physical one and it can be implemented by whatever means is
appropriate.
Therefore, in itself, it is pretty much uninteresting if it does not come
with the semantics of the operations.  And if it comes with the semantics,
then the physical format is pretty much uninteresting.  Indeed, some
HP machines have physical bits inverted from the logical ones -- and
that does not matter.

In short:  There is no point in having a multiplication of feature to test for
if the semantics is not there.


>
> Of couse, ECL may decide to support signed 0.

Which it does now; thanks to Juanjo,

-- Gaby




More information about the ecl-devel mailing list