W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2003

Re: Canonical representation of -0.0

From: Xan Gregg <xan.gregg@jmp.com>
Date: Mon, 13 Oct 2003 10:29:08 -0400
Cc: arjohn.kampman@aduna.biz
To: www-xml-schema-comments@w3.org
Message-Id: <9ACBA178-FD89-11D7-A579-000393BB384C@jmp.com>

> Reading through the definition of the datatype 'decimal' and working
> on an algorithm that normalizes these, I came across an exotic case 
> that
> might not be correctly normalized when the specs are followed. This 
> case
> is the decimal -0.0. If I understand the specs correctly, the canonical
> form of this decimal is again -0.0, but I would expect it to be 0.0. I
> scanned through the errate but couldn't find anything that's related to
> this. Can someone tell me if this is an error in the XML Schema
> datatypes specs?

Looks like an error in the description of canonical represention.  The 
canonicl represention is defined by prohibiting certain lexical 
representation, but "-0.0" is not prohibited, as you've observed. 
However, there is no negative zero in the value space of decimal, so 
"-0.0" presumably represents the same value as "0.0" (but, by 
definition, only one of them can be the canonical representation).  Or 
perhaps it is an error that "-0.0" is a valid lexical representation at 
all.

xan
Received on Monday, 13 October 2003 10:31:34 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:50:01 UTC