Firebird Documentation IndexFirebird 2.5 Language ReferenceData Types and Subtypes → Floating-Point Data Types
Firebird Home Firebird Home Prev: Integer Data TypesFirebird Documentation IndexUp: Data Types and SubtypesNext: Fixed-Point Data Types

Floating-Point Data Types

Table of Contents

FLOAT
DOUBLE PRECISION

Floating point data types are stored in an IEEE 754 binary format that comprises sign, exponent and mantissa. Precision is dynamic, corresponding to the physical storage format of the value, which is exactly 4 bytes for the FLOAT type and 8 bytes for DOUBLE PRECISION.

Considering the peculiarities of storing floating-point numbers in a database, these data types are not recommended for storing monetary data. For the same reasons, columns with floating-point data are not recommended for use as keys or to have uniqueness constraints applied to them.

For testing data in columns with floating-point data types, expressions should check using a range, for instance, BETWEEN, rather than searching for exact matches.

When using these data types in expressions, extreme care is advised regarding the rounding of evaluation results.

FLOAT

This data type has an approximate precision of 7 digits after the decimal point. To ensure the safety of storage, rely on 6 digits.

DOUBLE PRECISION

This data type is stored with an approximate precision of 15 digits.

Prev: Integer Data TypesFirebird Documentation IndexUp: Data Types and SubtypesNext: Fixed-Point Data Types
Firebird Documentation IndexFirebird 2.5 Language ReferenceData Types and Subtypes → Floating-Point Data Types