ASA SQL Reference
SQL Data Types
Numeric data types
A floating point number, which may be single or double precision.
FLOAT [ ( precision ) ]
When a column is created using the FLOAT ( precision ) data type, columns on all platforms are guaranteed to hold the values to at least the specified minimum precision. In contrast, REAL and DOUBLE do not guarantee a platform-independent minimum precision.
If precision is not supplied, the FLOAT data type is a single precision floating point number, equivalent to the REAL data type, and requires 4 bytes of storage.
If precision is supplied, the FLOAT data type is either single or double precision, depending on the value of precision specified. The cutoff between REAL and DOUBLE is platform-dependent. Single precision FLOATs require 4 bytes of storage, and double precision FLOATs require 8 bytes.
The FLOAT data type is an approximate numeric data type. It is subject to round-off errors after arithmetic operations. The approximate nature of FLOAT values means that queries using equalities should generally be avoided when comparing FLOAT values.
precision An integer expression that specifies the number of bits in the mantissa. A mantissa is the decimal part of a logarithm. For example, in the logarithm 5.63428, the mantissa is 0.63428. The IEEE standard 754 floating-point precision is as follows:
n | Decimal precision | Equivalent SQL data type | Storage size |
---|---|---|---|
1-24 | 7 decimal digits | REAL | 4 bytes |
25-53 | 15 decimal digits | DOUBLE | 8 bytes |
SQL/92 Compatible with SQL/92.
Sybase You can tune the behavior of the FLOAT data type for compatibility with Adaptive Server Enterprise, using the FLOAT_AS_DOUBLE option [compatibility].