W3C home > Mailing lists > Public > www-xpath-comments@w3.org > October to December 1999

Minus zero

From: Kay Michael <Michael.Kay@icl.com>
Date: Mon, 13 Dec 1999 13:58:31 -0000
Message-ID: <93CB64052F94D211BC5D0010A800133101FDE883@wwmess3.bra01.icl.co.uk>
To: "'www-xpath-comments@w3.org'" <www-xpath-comments@w3.org>
Cc: "'Scott_Boag/CAM/Lotus@lotus.com'" <Scott_Boag/CAM/Lotus@lotus.com>
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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:02:13 UTC