Bug #57519 Documentation for IEEE 754 compliance is missing
Submitted: 18 Oct 2010 11:25 Modified: 2 Jul 2018 13:59
Reporter: Daniël van Eeden Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Documentation Severity:S4 (Feature request)
Version:5.5 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any
Tags: compatibility, compliance, FLOAT, IEEE, STANDARDS

[18 Oct 2010 11:25] Daniël van Eeden
Description:
The numeric type overview page[1] in the manual indicates that FLOAT is based on the IEEE standard. 

The IEEE Standard for Floating-Point Arithmetic has two versions: IEEE 754-1985 [2] and IEEE 754-2008 [3]. To which of the two standards does MySQL conform?

The IEEE standard also defines special values[4] NaN, signed zero, infinity and subnormal numbers. Does MySQL support those?

IEEE Support in other databases:
PostgreSQL ans Sybase do support a few of the special values [5],[6]. The handling of FLOAT in MySQL is very different to Oracle 10g's. If 21.95 is inserted in a float and then searched for using a where a=21.95 will return no rows in MySQL but it does return a row in Oracle 10g.

There is documentation about handling of floats: [7], [8].

[1] http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html
[2] http://en.wikipedia.org/wiki/IEEE_754-1985
[3] http://en.wikipedia.org/wiki/IEEE_754-2008
[4] http://en.wikipedia.org/wiki/Floating_point#Special_values
[5] http://www.postgresql.org/docs/9.0/static/datatype-numeric.html
[6] http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc36271.1502/html...
[7] http://dev.mysql.com/doc/refman/5.1/en/problems-with-float.html
[8] http://dev.mysql.com/doc/refman/5.1/en/replication-features-floatvalues.html

How to repeat:
Read the spec

Suggested fix:
Adjust documentation and implement missing features.
[18 Oct 2010 14:32] Valeriy Kravchuk
I think we should start with documenting current details of IEEE 754 compliance properly. 

As for Oracle RDBMS, FLOAT there is just NUMBER with some predefined precision and scale, that is, machine-level floating point support is just not used, as far as I remember. Surely the results are different from MySQL...
[18 Oct 2010 14:49] Daniël van Eeden
In Oracle RDBMS a FLOAT is using decimal precision and a BINARY_FLOAT is using binary precision (Like MySQL's float).
[9 Nov 2014 13:28] Daniël van Eeden
Related: Bug #41442
[31 Jul 2015 20:56] Brendan McDonnell
How is it that a bug like this sits untouched for five years?

And the documentation doesn't even *mention* IEEE-754, leaving people who need NaNs to hunt for scraps of knowledge like this bug report.
[21 Nov 2015 12:29] Daniël van Eeden
See also:
http://0.30000000000000004.com/
https://github.com/erikwiffin/0.30000000000000004/issues/88
[2 Jul 2018 13:59] Paul DuBois
Posted by developer:
 
There does not appear to be an explicit development policy regarding this
behavior.