background image
<< DECIMAL data type | FLOAT data type >>

DOUBLE PRECISION data type

<< DECIMAL data type | FLOAT data type >>
Derby Reference Manual
198
--------
ERROR 22003: The resulting value is outside the range
for the data type DECIMAL/NUMERIC(5,2).
When mixed with other data types in expressions, the resulting data type follows the rules
shown in
Numeric type promotion in expressions
.
See also
Storing values of one numeric data type in columns of another numeric data
type
.
When two decimal values are mixed in an expression, the scale and precision of the
resulting value follow the rules shown in
Scale for decimal arithmetic
.
Integer constants too big for BIGINT are made DECIMAL constants.
Corresponding compile-time Java type
java.math.BigDecimal
JDBC metadata type (java.sql.Types)
DECIMAL
Examples
VALUES 123.456
VALUES 0.001
DOUBLE data type
The DOUBLE data type is a synonym for the
DOUBLE PRECISION
data type.
Syntax
DOUBLE
DOUBLE PRECISION data type
The DOUBLE PRECISION data type provides 8-byte storage for numbers using IEEE
floating-point notation.
Syntax
DOUBLE PRECISION
or, alternately
DOUBLE
DOUBLE can be used synonymously with DOUBLE PRECISION.
Limitations
DOUBLE value ranges:
· Smallest DOUBLE value: -1.79769E+308
· Largest DOUBLE value: 1.79769E+308
· Smallest positive DOUBLE value: 2.225E-307
· Largest negative DOUBLE value: -2.225E-307
These limits are different from the
java.lang.Double
Java type limits.
An exception is thrown when any double value is calculated or entered that is outside of
these value ranges. Arithmetic operations do not round their resulting values to zero. If
the values are too small, you will receive an exception.