FirebirdSQL logo

FLOAT

Data Type Declaration Format
FLOAT [(bin_prec)]
Table 1. FLOAT Type Parameters
Parameter Description

bin_prec

Precision in binary digits, default is 24

1 - 24: 32-bit single precision25 - 53: 64-bit double precision

The FLOAT data type defaults to a 32-bit single precision floating-point type with an approximate precision of 7 decimal digits after the decimal point (24 binary digits).To ensure the safety of storage, rely on 6 decimal digits of precision.

The syntax FLOAT(bin_prec) behaves as follows:

  • 1 <= _bin_prec <= 23: 32-bit single precision (synonym for FLOAT)

  • 25 <= _bin_prec <= 53: 64-bit double precision (synonym for DOUBLE PRECISION)

The behaviour of FLOAT (without explicit precision) behaves as the SQL standard type [fblangref50-datatypes-real].

Note
Compatibility Notes
  • Firebird 3.0 and earlier supported FLOAT(dec_prec) where dec_prec was the approximate precision in decimal digits, with 0 <= dec_prec <= 7 mapped to 32-bit single precision and P > 7 mapped to 64-bit double precision.This syntax was never documented.

  • For bin_prec in FLOAT(bin_prec), the values 1 <= bin_prec <= 24 are all treated as bin_prec = 24, values 25 <= bin_prec <= 53 are all handled as bin_prec = 53.

  • Most Firebird tools will report FLOAT(1) — FLOAT(24) as FLOAT, and FLOAT(25) — FLOAT(53) as DOUBLE PRECISION.

REAL

Data Type Declaration Format
REAL

The data type REAL is a synonym for FLOAT, and is provided for syntax compatibility.When used to define a column or parameter, it’s indistinguishable from using FLOAT or FLOAT(1) — FLOAT(24).

Note
Compatibility Note
  • REAL has been available as a synonym for FLOAT since Firebird 1.0 and even earlier, but was never documented.

  • Most Firebird tools will report FLOAT instead of REAL.