[DFDL-WG] Action 081: Clarification of NaN and Inf
Alan Powell
alan_powell at uk.ibm.com
Thu Feb 18 05:26:54 CST 2010
DFDL support for Infinity and Nan need clarification. There are two
aspects
Representation of infinity and Nan in the infoset
Representation of Infinity and Nan in the datastream
Representation of infinity and Nan in the infoset
DFDL should follow XML which allows +inf, -inf and Nan for Float and
Double
>From XML Schema Part 2: Datatypes Second Edition
[Definition:] float is patterned after the IEEE single-precision 32-bit
floating point type [IEEE 754-1985]. The basic ·value space· of float
consists of the values m × 2^e, where m is an integer whose absolute value
is less than 2^24, and e is an integer between -149 and 104, inclusive. In
addition to the basic ·value space· described above, the ·value space· of
float also contains the following three special values: positive and
negative infinity and not-a-number (NaN). The ·order-relation· on float
is: x < y iff y - x is positive for x and y in the value space. Positive
infinity is greater than all other non-NaN values. NaN equals itself but
is ·incomparable· with (neither greater than nor less than) any other
value in the ·value space·.
The special values positive and negative infinity and not-a-number have
lexical representations INF, -INF and NaN, respectively. Lexical
representations for zero may take a positive or negative sign.
Similarly description for Double
Minor changes to infoset [dataValue] description
1. [dataValue] The value in the value space (as defined by XML Schema
Part 2: Datatypes [XSDLV1] ) of the [datatype] member or special value
nil. In a complex element information item this member has no value. For
information items of datatype xs:string, the value will be the ISO10646
character codes of the string and 'implicit' (also known as logical),
left-to-right bidirectional ordering and orientation.
Is it sufficient just to refer to XML schema rather than spell out the
value spaces in this specification?
Representation of Infinity and Nan in the data stream
ICU allows a single character for Nan and infinity. The infinity character
can be prefixed by the positive or negative prefix (ie the prefix part of
he pattern)
This is too restrictive for DFDL as we need to be able to support at least
'INF' '-INF' and 'NaN'
Only minor changes to current description.
numberInfinityRep
String
The value used to represent infinity.
Infinity is represented as string with the positive or negative prefixes
and suffixes from the numberPattern applied
This property is applicable when dfdl: textNumberRepresentation is
'standard' and the simple type type is float or double.
Annotation: dfdl:textNumberFormat
numberNaNRep
String
The value used to represent NaN.
NaN is represented as string and the positive or negative prefixes and
suffixes from the numberPattern are not used
This property is applicable when dfdl: textNumberRepresentation is
'standard' and the simple type type is float or double.
Annotation: dfdl:textNumberFormat
Regards
Alan Powell
Development - MQSeries, Message Broker, ESB
IBM Software Group, Application and Integration Middleware Software
-------------------------------------------------------------------------------------------------------------------------------------------
IBM
MP211, Hursley Park
Hursley, SO21 2JN
United Kingdom
Phone: +44-1962-815073
e-mail: alan_powell at uk.ibm.com
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.ogf.org/pipermail/dfdl-wg/attachments/20100218/b032ec62/attachment.html
More information about the dfdl-wg
mailing list