[fpc-devel] MySQL 5.1 and Double (trouble)
Andrew Brunner
andrew.t.brunner at gmail.com
Mon Jul 11 18:46:42 CEST 2011
On Mon, Jul 11, 2011 at 11:55 AM, Hans-Peter Diettrich
<DrDiettrich1 at aol.com> wrote:
> The binary value consists of an exponent and an significand (mantissa), most
> probably you forgot to count the exponent and sign bits.
The problem I'm trying to describe is with double precision floating
point values. When the query is open and one of the parameters is
double MySQL does not receive all of the memory. It's missing two
bits. That is a problem with either the mysql5.1 driver or with the
mysql51 component w/r/t the double data type.
> I'd suggest that you read a bit about using floating point numbers. They
> never are accurate, and every decimal representation adds more inaccuracy
I could understand if you wanted to bring this fact into argument over
arithmetic and cumulative error. But the fact is - if I send a double
precision data value to a double precision field in the SQL database -
that value had better be the same - "bit for bit". Now if someone is
being bit shifty on the conversion - that needs to be a addressed.
More information about the fpc-devel
mailing list