-0.0 in Common Lisp



In 1993, I said

"Either IEEE = is not an identity predicate or IEEE atan is not a function, because 0.0=-0.0, but atan(0.0,-0.0)!=atan(-0.0,-0.0); due to this and other reasons, IEEE -0.0 is an algebraic abomination."

More succinctly, -0.0 violates the concept of "referential transparency"; i.e., the ability to substitute equals for equals.

http://www.pipeline.com/~hbaker1/ObjectIdentity.html

At 09:30 AM 12/3/2012, Raymond Toy wrote:
>CL doesn't forbid signed zeroes.  Any CL that uses the IEEE754
>hardware will get signed zeroes whether you want it or not.  In fact,
>for lisps that "don't" support signed zeroes, I think the only real
>issue is that the lisp printer and reader doesn't support signed
>zeroes.  If that's changed, you get signed zeroes automatically,
>because the hardware has it.