xs:double

The data type xs:double is supported in XQuery by the IEEE 64-bit decimal floating point.

Lexical form of xs:double

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 exponent and 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.

The special values positive infinity, negative infinity, and not-a-number have the lexical representations INF, -INF and NaN, respectively. Lexical representations for zero can take a positive or negative sign. The following literals are all valid examples of a double: -1E4, 1267.43233E12, 12.78e-2, 12 , -0, 0 and INF.

Constructor of xs:double

Use the following syntax to construct an instance of xs:double:

Read syntax diagramSkip visual syntax diagramxs:double( value)
value
The value that is to be constructed. If this value is an empty sequence, the empty sequence is returned.

If value is illegal for the target data type, the constructor function returns an error.