php/php-src — pull request #772 by keyurdg (2014-08-14 18:23:06+00:00)
Title: Fix for bug 67839 (mysqli does not handle 4-byte floats correctly)

Before the patch, a value of 9.99 in a FLOAT column came out of mysqli
as 9.9998998641968. This is because it would naively cast a 4-byte float
into PHP's internal 8-byte double.
To fix this, with GCC we use the built-in decimal support to "up-convert"
the 4-byte float to a 8-byte double.
When that is not available, we fall back to converting the float
to a string and then converting the string to a double. This mimics
what MySQL does.