DOUBLE Function

The DOUBLE function has three forms, each of which returns a double-precision value.

The following form of the DOUBLE function returns the value of the arithmetic expression extended to a double-precision value.

── DOUBLE ── ( ──<arithmetic expression>── ) ──────────────────────────┤

The following form of the DOUBLE function returns a double-precision value in which the first word is equal to the value of the first arithmetic expression and the second word is equal to the value of the second arithmetic expression. The arithmetic expressions are first truncated to single-precision, if necessary.

── DOUBLE ── ( ──<arithmetic expression>── , ──<arithmetic expression>─►
►─ ) ──────────────────────────────────────────────────────────────────┤

The following form of the DOUBLE function returns, as a double-precision value, the decimal value represented by the string of characters starting with the character pointed to by the pointer expression.

── DOUBLE ── ( ─┬──────────────────┬─<pointer expression>── , ─────────►
                └─<update pointer>─┘
►─<arithmetic expression>── ) ─────────────────────────────────────────┤

A zone field configuration of 1"1101" in the least significant character position causes the result of the function to be negative. With 4-bit characters, a 1"1101" in the most significant character position results in a negative value.

When the pointer expression is a hexadecimal pointer or a hexadecimal array, if the character in the most significant character position is not in the range 0 through 9, the character is assumed to be a sign. Therefore, the number of characters processed is one greater than that specified by the arithmetic expression. This character affects the value of the update pointer.

If the string of characters is all 1"11111111" (48"FF") for 8-bit characters or 1"1111" (4"F") for 4-bit characters, the string is treated as though it were a sequence of nines. In the 4-bit character case, the first character is treated as a sign (positive).

Other than the above special cases, if the numeric field of each character in the string of characters contains anything other than a digit the results are undefined and can vary.

The state of the pointer expression when the count is exhausted can be preserved by the use of the <update pointer> construct.