Numeric to Double:
>>--+-DOUBLE-----------+---(--numeric-expression--)------------>< +-FLOAT------------+ '-DOUBLE_PRECISION-'
Character String to Double:
>>-DOUBLE--(--string-expression--)-----------------------------><
The schema is SYSIBM. However, the schema for DOUBLE(string-expression) is SYSFUN.
The DOUBLE function returns a floating-point number corresponding to a:
The result of the function is a double-precision floating-point number. If the argument can be null, the result can be null; if the argument is null, the result is the null value.
The result is the same number that would occur if the argument were assigned to a double-precision floating-point column or variable.
The result of the function is a double-precision floating-point number. The result can be null; if the argument is null, the result is the null value.
The result is the same number that would occur if the string was considered a constant and assigned to a double-precision floating-point column or variable.
Example:
Using the EMPLOYEE table, find the ratio of salary to commission for employees whose commission is not zero. The columns involved (SALARY and COMM) have DECIMAL data types. To eliminate the possibility of out-of-range results, DOUBLE is applied to SALARY so that the division is carried out in floating point:
SELECT EMPNO, DOUBLE(SALARY)/COMM FROM EMPLOYEE WHERE COMM > 0