Name
xs:float
Synopsis
The xs:float
type represents four-byte, binary floating-point
numbers in IEEE-754 format, such as is the float
type in Java and many C compilers.
This includes the special values INF
for infinity and NaN
for not a number, used for the
results of unconventional operations like dividing by zero and
taking the square root of a negative number. Because not all
binary numbers can be precisely represented by decimal numbers, it
is possible that two different decimal representations in the
lexical space map to the same value (and vice versa). In this
case, the closest approximation of the IEEE-754 value is chosen.
These are all legal values of type xs:float
:
3.1415292
-03.1415292
6.022E23
127E-13
+2.998E+10
-128e12
0.0
INF
NaN
-INF
Constraining facets that apply to xs:float
are minInclusive
, maxInclusive
, minExclusive
, maxExclusive
, pattern
, enumeration
, and whiteSpace
.
Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.