W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2002

Seeking clarification on doubld/float

From: <peiyongz@ca.ibm.com>
Date: Tue, 26 Nov 2002 14:29:34 -0500
To: xmlschema-dev@w3.org
Message-ID: <OFDBCD7B77.A382FC37-ON85256C7D.0068C8D1@torolab.ibm.com>

Hi, there,

          We have encountered numerous test cases wrt double/float, which
have numbers that we think
          are not valid double/float according to the Specs, and would like
to have clarification from the
          Schema WG to confirm that our interpretation is conformant to the
Specs.

          Following is an exerpt from the Schema Spec,
http://www.w3.org/TR/xmlschema-2/#double

     3.2.5 double


    [Definition:]  The double datatype corresponds to IEEE double-precision
    64-bit floating point type [IEEE 754-1985]. The basic ˇvalue spaceˇ of
    double consists of the values m × 2^e, where m is an integer whose
    absolute value is less than 2^53, and e is an integer between -1075 and
    970, inclusive. In addition to the basic ˇvalue spaceˇ described above,
    the ˇvalue spaceˇ of double also contains the following special values:
    positive and negative zero, positive and negative infinity and
    not-a-number. The ˇorder-relationˇ on double is: x < y iff y - x is
    positive. Positive zero is greater than negative zero. Not-a-number
    equals itself and is greater than all double values including positive
    infinity.



    From the above, could we reach the conclusions  below?



    #1. Any thing falling in either of the 2 areas, is considered to be
    valid double.


          [ (-2^53 + 1) * 2^970, -1 * 2^-1075]


          [ 1 * 2^ -1075, (2^53 - 1) * 2^ 970].


          (not to mention the other five -0, 0, -INF, INF and NaN)


    #2. Any thing falling in either of the 4 areas, is considered to be
    invalid double.


          ( -INF, (-2^53 + 1) * 2^970 )


          ( -1 * 2^ -1075, 0)


          ( 0, 1 * 2^-1075)


          ( (2^53 - 1) * 2^ 970,  INF )


    Legend: "[" , "]" denotes inclusive, or closed


                    "(" , " )" denotes exclusive, or open


    The same discussion shall be applicable to float as well ( with
    different boundary values only), thanks.



    Regards,

    Peiyong Zhang
    ____________________________________________
    XML Parsers Development, D2-265
    IBM Toronto Laboratory , 8200 Warden, Markham

    Email: peiyongz@ca.ibm.com
    Phone: (905)413-4088
    Fax: (905)413-4854; T/L: 778-4088
Received on Tuesday, 26 November 2002 14:33:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:35 GMT