background image
<< LONG VARCHAR data type | TIME data type >>

REAL data type

<< LONG VARCHAR data type | TIME data type >>
Derby Reference Manual
201
Corresponding compile-time Java type
java.math.BigDecimal
JDBC metadata type (java.sql.Types)
NUMERIC
Examples
123.456
.001
REAL data type
The REAL data type provides 4 bytes of storage for numbers using IEEE floating-point
notation.
Syntax
REAL
Corresponding compile-time Java type
java.lang.Float
JDBC metadata type (java.sql.Types)
REAL
Limitations
REAL value ranges:
· Smallest REAL value: -3.402E+38
· Largest REAL value: 3.402E+38
· Smallest positive REAL value: 1.175E-37
· Largest negative REAL value: -1.175E-37
These limits are different from the
java.lang.Float
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. The arithmetic operations take
place with double arithmetic in order to detect under flows.
Numeric floating point constants are limited to a length of 30 characters.
-- this example will fail because the constant is too long:
values 01234567890123456789012345678901e0;
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
.
Constants always map to DOUBLE PRECISION; use a CAST to convert a constant to a
REAL.
SMALLINT data type
SMALLINT provides 2 bytes of storage.
Syntax