Author: wyoung
Date: Wed Apr 2 02:02:15 2008
New Revision: 2265
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2265&view=rev
Log:
Bumped float -> string precisions to 9 and 17 digits, per data collected
by Google and Jim Wallace, confirmed by Dave Bailey.
Modified:
trunk/lib/stadapter.cpp
Modified: trunk/lib/stadapter.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/stadapter.cpp?rev=2265&r1=2264&r2=2265&view=diff
==============================================================================
--- trunk/lib/stadapter.cpp (original)
+++ trunk/lib/stadapter.cpp Wed Apr 2 02:02:15 2008
@@ -250,7 +250,7 @@
is_processed_(false)
{
ostringstream outs;
- outs.precision(8); // max dec digits in IEEE 754 32-bit float < 8
+ outs.precision(9); // max dec digits needed for IEEE 754 32-bit
float
outs << f;
buffer_ = new SQLBuffer(outs.str(), typeid(f), false);
}
@@ -264,7 +264,7 @@
}
else {
ostringstream outs;
- outs.precision(8); // as above
+ outs.precision(9); // as above
outs << f;
buffer_ = new SQLBuffer(outs.str(), typeid(f.data), false);
}
@@ -275,7 +275,7 @@
is_processed_(false)
{
ostringstream outs;
- outs.precision(16); // max dec digits in IEEE 754 64-bit float < 16
+ outs.precision(17); // max dec digits needed for IEEE 754 64-bit
float
outs << f;
buffer_ = new SQLBuffer(outs.str(), typeid(f), false);
}
@@ -289,7 +289,7 @@
}
else {
ostringstream outs;
- outs.precision(16); // as above
+ outs.precision(17); // as above
outs << f;
buffer_ = new SQLBuffer(outs.str(), typeid(f.data), false);
}
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits