XML technologies / XML Schema / Data type reference / xs:float
(Excerpt from “XML Schema” by Eric van der Vlist)
IEEE 32-bit floating-point numbers
Derived from: xs:anySimpleType
Primitive type: xs:float
Known subtypes: none
Facets: xs:enumeration, xs:maxExclusive, xs:maxInclusive, xs:minExclusive, xs:minInclusive, xs:pattern, xs:whiteSpace
Definition
<xs:simpleType name="float" id="float">
<xs:restriction base="xs:anySimpleType">
<xs:whiteSpace value="collapse" fixed="true"/>
</xs:restriction>
</xs:simpleType>Description
The value space of xs:double consists of IEEE single-precision floating-point numbers, 32-bit float. The lexical space uses decimal format with optional exponential notation. Mapping the lexical space, powers of ten, to the value space, powers of two, is approximate and uses the nearest value.
This data type distinguishes positive 0 from negative -0 and includes special values -INF, negative infinity, INF, positive infinity, and NaN, Not a Number.
The lexical spaces of xs:float and xs:double are identical; only the precision of mapping into the value space differs.
Restrictions
The decimal separator is always a period (.), and no thousands separator is allowed.
Example
Valid values include: "123.456", "+1234.456", "-1.2344e56", "-.45E-6", "INF", "-INF" or "NaN".
The following values would be invalid: "1234.4E 56" (spaces are forbidden), "1E+2.5" (the decimal exponent must be an integer), "+INF" (positive infinity takes no sign) or "NAN" (special values are case-sensitive).
Copyright © 2003 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from “XML Schema” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de