<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
May be, that this can be fixed in sqldb.pp in function
TSQLConnection.GetAsSQLText(Param: TParam) : string; <br>
...<br>
- ftFloat : Result := FloatToStr(Param.AsFloat,
FSQLFormatSettings);<br>
+ ftFloat : Result := FloatToStrF(extended(Param.AsFloat),
ffGeneral, 16, 0, FSQLFormatSettings); <br>
...<br>
for me it seems, that works ... See atached program.<br>
What do you think ?<br>
-Laco.<br>
<br>
<blockquote
cite="mid:CAM=dd2jtvXnS77oDF7COg2gsK3AJ+pQfAkV=__zcp+8Sav-LoA@mail.gmail.com"
type="cite">
<pre wrap="">On Mon, Jul 11, 2011 at 11:55 AM, Hans-Peter Diettrich
<a class="moz-txt-link-rfc2396E" href="mailto:DrDiettrich1@aol.com"><DrDiettrich1@aol.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">The binary value consists of an exponent and an significand (mantissa), most
probably you forgot to count the exponent and sign bits.
</pre>
</blockquote>
<pre wrap=""><!---->
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.
</pre>
<blockquote type="cite">
<pre wrap="">I'd suggest that you read a bit about using floating point numbers. They
never are accurate, and every decimal representation adds more inaccuracy
</pre>
</blockquote>
<pre wrap=""><!---->
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.
_______________________________________________
fpc-devel maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freepascal.org/mailman/listinfo/fpc-devel">http://lists.freepascal.org/mailman/listinfo/fpc-devel</a>
</pre>
</blockquote>
<br>
</body>
</html>