double data type

The xs:double data type is patterned after the IEEE double-precision 64-bit floating point type. Derived from data type xdt:anyAtomicType.

The basic value space of xs:double consists of values that range from -1.7976931348623158e+308 to -2.2250738585072014e-308 and from +2.2250738585072014e-308 to +1.7976931348623158e+308. The value space of xs:double also includes the following special values: positive infinity, negative infinity, positive zero, negative zero, and not-a-number (NaN).

The lexical form of xs:double is a mantissa followed, optionally, by the character E or e, followed by an exponent. The exponent must be an integer. The mantissa must be a decimal number. The representations for the exponent and the mantissa must follow the lexical rules for xs:integer and xs:decimal. If the E or e and the exponent that follows are omitted, an exponent value of 0 is assumed.

Lexical forms for zero can take a positive or negative sign. The following literals are valid examples of this data type: -1E4, 1267.43233E12, 12.78e-2, 12 , -0, and 0.

The special values positive infinity, negative infinity, and not-a-number have the lexical forms INF, -INF and NaN, respectively. The lexical form for positive infinity cannot take a positive sign.

Tip: There is no literal for the special values INF, -INF and NaN. Construct the values INF, -INF, and NaN from strings by using the xs:double type constructor. For example: xs:double("INF").