Minus zero

The XPath specification has little to say about the semantics of the unary
minus operator, it seems to be covered by the remark that "The - operator
performs subtraction."

Saxon therefore interprets unary minus as subtraction from zero, so -0 means
(+0.0 subtract +0.0) which is (I think) positive zero. LotusXSL appears to
treat XPath "-0" as meaning IEEE 754 negative zero, which seems natural, but
I cannot find any justification for this in the spec.

The Java language spec explicitly states that the floating point unary minus
operator does NOT mean subtraction, it means inverting the sign. There
doesn't seem to be any corresponding statement in XPath.

Should "-0" in XPath be interpreted as positive zero or negative zero?

Mike Kay 

Received on Monday, 13 December 1999 08:58:41 UTC