-0.0 in Common Lisp



>>>>> "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.

Ray