<div dir="ltr"><div>Mind the title, it's positive zero, not infinity :)<br></div><br><div class="gmail_extra"><br><div class="gmail_quote">2017-01-27 8:42 GMT+01:00  <span dir="ltr"><<a href="mailto:Das.Linux@gmx.de" target="_blank">Das.Linux@gmx.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi<br>
<span class="gmail-"><br>
On 27.01.2017, at 08:37, Tobias Pape <<a href="mailto:Das.Linux@gmx.de">Das.Linux@gmx.de</a>> wrote:<br>
<br>
> Hi all,<br>
><br>
> it seems, we also suffer from this bug:<br>
><br>
> { 0 sign.<br>
> 0.0 sign.<br>
> -0 sign.<br>
> -0.0 sign.<br>
> }<br>
> "=>  #(0 0 0 -1)"<br>
<br>
</span>PS: why bug?<br></blockquote><div><br><div>It's a bug because it is against ANSI smalltalk, and because it creates small incompatibilities with gemstone 
unecessarily.<br></div>I have a patch ready for squeak.<br><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
IEEE-754 says that 0.0 and -0.0 are equal and equal numbers have same sign,<br>
but for us<br>
<br>
        (0.0 = -0.0) ==> (0.0 sign = -0.0 sign)<br>
<br>
is false, while it should be true.<br>
<div class="gmail-HOEnZb"><div><br></div></div></blockquote><div><br></div><div>More exactly, the logic is rather: the sign of zero is zero.<br></div><div>Float negativeZero value cannot be distinguished from zero, so it is zero, and sign should be zero.<br><br></div><div>But we can still have another message like signBit immune to this logic.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5">
><br>
> Begin forwarded message:<br>
><br>
>> From: Martin McClure via Glass <<a href="mailto:glass@lists.gemtalksystems.com">glass@lists.gemtalksystems.<wbr>com</a>><br>
>> Subject: Re: [Glass] Negative infinity and positive infinity have the same sign<br>
>> Date: 26. Januar 2017 21:10:32 MEZ<br>
>> To: monty <<a href="mailto:monty2@programmer.net">monty2@programmer.net</a>>, <a href="mailto:glass@lists.gemtalksystems.com">glass@lists.gemtalksystems.com</a><br>
>> Reply-To: Martin McClure <<a href="mailto:martin.mcclure@gemtalksystems.com">martin.mcclure@<wbr>gemtalksystems.com</a>><br>
>> Delivered-To: <a href="mailto:glass@mail.commonhouse.net">glass@mail.commonhouse.net</a><br>
>><br>
>> On 01/25/2017 12:45 PM, monty via Glass wrote:<br>
>>> On 3.3.0, "-0.0 sign = 0.0 sign". On Pharo, "-1 sign = -1", "-0.0 sign = -1", "0.0 sign = 0", and "1 sign = 1". IEEE Standard 754 mandates that negative zero have the same sign bit as a negative number.<br>
>>> ______________________________<wbr>_________________<br>
>> Hi Monty,<br>
>><br>
>> The ANSI Smalltalk standard says that #sign should answer 0 if "the<br>
>> receiver equals zero". This agrees with ISO/IEC 10967 Portable Numerics<br>
>> standard, which says the same thing. The IEEE 754 spec does not specify<br>
>> a "sign" operation. The closest equivalent I see is the "isSignMinus"<br>
>> operation. We don't currently have that message in GemStone, but we<br>
>> might add it. In GemStone, you can distinguish positive and negative<br>
>> zero by sending #_sign.<br>
>><br>
>> Pharo's implementation seems very odd. It looks like it's been that way<br>
>> a long time (John Maloney in 1998?) but the comment contradicts itself.<br>
>> It says<br>
>> "Answer 1 if the receiver is greater than 0, -1 if less than 0, else 0.<br>
>>   Handle IEEE-754 negative-zero by reporting a sign of -1"<br>
>><br>
>> But negative zero *is* equal to 0, so it claims to be answering both 0<br>
>> and -1 for -0.0. Leaving that aside, it's disturbingly asymmetric to<br>
>> answer 0 for 0.0 but -1 for -0.0.<br>
>><br>
>> Regards,<br>
>><br>
>> -Martin<br>
>> ______________________________<wbr>_________________<br>
>> Glass mailing list<br>
>> <a href="mailto:Glass@lists.gemtalksystems.com">Glass@lists.gemtalksystems.com</a><br>
>> <a href="http://lists.gemtalksystems.com/mailman/listinfo/glass" rel="noreferrer" target="_blank">http://lists.gemtalksystems.<wbr>com/mailman/listinfo/glass</a><br>
><br>
><br>
<br>
<br>
</div></div></blockquote></div><br></div></div>