The DINTEGER function has two forms, each of which returns a double-precision value.
The following form of DINTEGER function returns the value of the arithmetic expression as a double-precision value. The sign of the returned value is positive if the value of the arithmetic expression is greater than or equal to zero and is negative otherwise.
── DINTEGER ── ( ──<arithmetic expression>── ) ────────────────────────┤
Specifically, the function returns the following for positive-valued arithmetic expressions:
DOUBLE (ENTIER (<arithmetic expression> + 0.5))
The function returns the following for negative-valued arithmetic expressions:
DNABS (ENTIER (ABS (<arithmetic expression>) + 0.5))
The following form of the DINTEGER function returns the decimal value represented by the string of characters indicated by the pointer expression, as a double integer value. The absolute value of the integer value to be returned must be less than or equal to 3.02231454903657293676543@@23.
── DINTEGER ── ( ─┬──────────────────┬─<pointer expression>── , ───────►
└─<update pointer>─┘
►─<arithmetic expression>── ) ─────────────────────────────────────────┤The arithmetic expression specifies the length of the string of characters and must have a value, when rounded to an integer, less than 24. If the rounded value of the arithmetic expression is 24 or greater, the program is terminated with a fault. If the length is 0 (zero), a result of 0 is returned.
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 using the update pointer construct.

