W3C home > Mailing lists > Public > public-qt-comments@w3.org > March 2004

RE: [F+O] Division by zero question

From: Ashok Malhotra <ashokma@microsoft.com>
Date: Tue, 16 Mar 2004 14:01:57 -0800
Message-ID: <EDB607C8AC991F40BE646533A1A673E80188464B@RED-MSG-42.redmond.corp.microsoft.com>
To: "Michael Kay" <mhk@mhk.me.uk>, <public-qt-comments@w3.org>

Mike:
Thank you for your comment.  The WGs discussed this and agreed to make
the change.

All the best, Ashok

-----Original Message-----
From: public-qt-comments-request@w3.org
[mailto:public-qt-comments-request@w3.org] On Behalf Of Michael Kay
Sent: Thursday, February 19, 2004 12:52 AM
To: public-qt-comments@w3.org
Subject: [F+O] Division by zero question



I am passing this on from one of my users, who pointed out that Saxon's
behavior differs from the spec. I believe that Saxon is correct and the
spec is wrong.

The referenced statement in the spec is: "For xs:float and xs:double
operands, floating point division is performed as specified in [IEEE
754-1985] and INF or -INF is returned if the divisor is zero."

But I believe that according to IEEE 754, dividing zero by zero gives
NaN.

It would be better not to make normative statements that attempt to
precis IEEE 754: it would be much safer if such things were said in
notes, so that it is clear the IEEE definition is the normative one.

Michael Kay


-----Original Message-----
From: saxon-help-admin@lists.sourceforge.net
[mailto:saxon-help-admin@lists.sourceforge.net] On Behalf Of Erik
Bruchez
Sent: 19 February 2004 01:19
To: saxon-help@lists.sourceforge.net
Subject: [saxon] Division by zero question


Consider this example:

   <xsl:value-of select="xs:double(0) div 0"/>

This operates a floating-point division. With Saxon 7.8, this returns
NaN, but the spec does specify that INF and -INF are returned in the
case of a division by zero:

http://www.w3.org/TR/xpath-functions/#func-numeric-divide

Is this a bug in Saxon, a bug or imprecision in the spec, or is this
implicitly covered by [IEEE 754-1985]?

-Erik
Received on Tuesday, 16 March 2004 17:02:29 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:13:56 UTC