W3C home > Mailing lists > Public > xsl-editors@w3.org > July to September 2000

XPath-negative-zero-multiply

From: James Clark <jjc@jclark.com>
Date: Tue, 26 Sep 2000 12:32:18 +0700
Message-ID: <39D034E2.3E4BF09A@jclark.com>
To: XSL WG <w3c-xsl-wg@w3.org>
CC: David_Marston@lotus.com, xsl-editors@w3.org
David_Marston@lotus.com wrote:

> [XPath-negative-zero-multiply] Does the product of -0 and any non-zero
> number equal -0? Does (-0)*0 equal -0? Does (-0)*(-0) equal 0? Does (-0)
> div {any non-zero number} equal -0?

The short answer is that according to IEEE 754, for both multiplication
and division the rule is that if the result is not NaN, then the result
is positive if and only if both operands have the same sign. See, eg

  http://java.sun.com/docs/books/jls/html/15.doc.html#5036

Thus the answers to your questions are: no, yes, yes, no.

James
Received on Tuesday, 26 September 2000 01:38:08 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:50 GMT