>>>>> "Richard" == Richard Fateman <fateman at eecs.berkeley.edu> writes:
Richard> On 12/4/2012 1:14 PM, Raymond Toy wrote:
>>>>>>> "Richard" == Richard Fateman <fateman at eecs.berkeley.edu>
>>>>>>> writes:
Richard> I've been fiddling around with Allegro CL 9.0 and can't
Richard> seem to produce a -0.0, so maybe I'm being overly
Richard> optimistic about support for negative zero. It seems
Richard> that CMU CL might provide support though.
>>
>> I know cmucl supports it, as does sbcl.
>>
>> A quick test with ccl and ecl shows that they also support
>> signed zeroes.
>>
>> Of course, there's more to supporting signed zeroes than making
>> (eql -0.0 0.0) return false. You should get all of the branch
>> cuts for the special functions correct too. That's a much,
>> much harder problem. I'm not sure cmucl has this all correct.
>>
>> The only time I've been bitten by signed zeroes is when dealing
>> with branch cuts. And those are always hard, whether you have
>> signed zeroes or not.
Richard> This might help
Richard> http://port70.net/~nsz/articles/float/kahan_branch_cuts_complex_elementary_functions_1987.pdf
Yes, I've used the routines in there. In fact, many of them are now
used in maxima for the bfloat routines. With modificatons since
bfloats don't have signed zeroes. :-)
Richard> I think it is important to keep in mind, with regard to
Richard> computer algebra systems, that the IEEE standard is
Richard> intended to be an engineering compromise between the
Richard> needs of arithmetic and the constraints that floating
Richard> point numbers must fit in a finite space such as 32, 64
Richard> or perhaps 128 bits, but fixed. And that overflow and
Richard> underflow are eventualities that must be accommodated
Richard> because the exponent fields are fixed.
There's a little known fact (I think) that IEEE says on overflow that
the resulting product should have the correct mantissa and the
exponent is correctly adjusted. That is, if you have an overflow
handler and look at the result, the true answer is there if you add
max exponent to the actual exponent. With enough work, you could have
unlimited exponents if you manually keep track of overflows and
underflows.
The only chip I know of that implemented this was ppc. I know sparc
doesn't. Can't remember if x86 does.
But this is getting way off topic now.
Ray