7 messages in com.mysql.lists.plusplusRe: Loss of float precision
FromSent OnAttachments
Warren Young24 Mar 2008 16:30 
Jim Wallace01 Apr 2008 11:48 
Warren Young01 Apr 2008 16:07 
Dave Bailey01 Apr 2008 16:31 
Warren Young01 Apr 2008 17:03 
Jim Wallace01 Apr 2008 17:40 
Warren Young01 Apr 2008 19:50 
Subject:Re: Loss of float precision
From:Warren Young (mysq@etr-usa.com)
Date:04/01/2008 04:07:46 PM
List:com.mysql.lists.plusplus

Jim Wallace wrote:

Below is output from a test program (copying the code from MySQL++) that prints out a float with %f and ostringstream with increasing precision. You can see 9 is a better value than 7, but higher than 9 doesn't help.

After reading some of this: http://en.wikipedia.org/wiki/Floating_point

...I can see going to 8. The article says "about 7 decimal digits", but that just means it's between 7 and 8, closer to 7 in this instance.

What I don't understand is why going to 9 helps. If we assume that your floating point implementation is adhering to the IEEE 754 standard, the bits just aren't there to do anything significant with more than 8 digits.

As for double, we may not have to change anything: "about 16 digits" means between 15 and 16, closer to 16.

I haven't investigated SQLSS will it do the same thing?

It uses the same underlying conversion mechanism as the rest of the library in v3: SQLTypeAdapter.