SQL-J Language Reference
Page 97 of 121

FLOAT

The FLOAT data type is an alias for a REAL or DOUBLE PRECISION data type, depending on the precision you specify.

Syntax for Column Definition

FLOAT [ (precision) ]

The default precision for FLOAT is 53 and is equivalent to DOUBLE PRECISION. A precision of 23 or less makes FLOAT equivalent to REAL. A precision of 24 or greater makes FLOAT equivalent to DOUBLE PRECISION. If you specify a precision of 0, you get an error. If you specify a negative precision, you get a syntax error.

Corresponding Compile-Time Java Type

java.lang.Float (precision of 23 or less) or java.lang.Double (precision of 24 or greater)

JDBC Metadata Type (java.sql.Types)

REAL or DOUBLE

Minimum Value

4.9E-324 (java.lang.Double.MIN_VALUE) if using a precision of 24 or greater

1.4E-45 (java.lang.Float.MIN_VALUE) if using a precision of 23 or less

Maximum Value

1.7976931348623157E308 (java.lang.Double.MAX_VALUE) if using a precision of 24 or greater.

3.4028235E38 (java.lang.Float.MAX_VALUE) if using a precision of 23 or less

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.