Changing FLOAT to a SQL standard compliant FLOAT datatype [CORE6109] #6358
Submitted by: @mrotteveel
Currently Firebird has two documented floating point datatypes:
- FLOAT (a 32 bit single precision)
Firebird also has the - undocumented - datatypes
In addition, Firebird supports - again, undocumented - FLOAT(p) with p in decimal precision, where
The SQL standard however defines FLOAT differently. From SQL:2016 6.1 <data type>:
20) If a <precision> is omitted, then an implementation-defined <precision> is implicit.
21) The value of a <precision> shall be greater than 0 (zero). [..]
30) REAL specifies the data type approximate numeric, with implementation-defined precision.
31) DOUBLE PRECISION specifies the data type approximate numeric, with implementation-defined precision that is greater than the implementation-defined precision of REAL.
32) For the <approximate numeric type>s FLOAT, REAL, and DOUBLE PRECISION, the maximum and minimum values of the exponent are implementation-defined.
I propose that for Firebird 4 we bring this inline with the standard:
1. Change and document FLOAT(p) to apply precision in binary digits, that is:
This change will break backwards compatibility for FLOAT(p), but as the precision syntax for FLOAT was never documented, I think that is an acceptable tradeoff to gain better standard compliance.
The text was updated successfully, but these errors were encountered: