-
Notifications
You must be signed in to change notification settings - Fork 354
Closed
Description
We are using a table containing floats, and have tests that use random values. The builtin serializers use std::ostringstream as underlying implementation, which defaults to std::ios_base::precision() == 6. This implies that values are quite quickly truncated.
A quick hack of
diff --git a/include/sqlpp11/sqlite3/connection.h b/include/sqlpp11/sqlite3/connection.h
index 79b3ae6..bd1a8ea 100644
--- a/include/sqlpp11/sqlite3/connection.h
+++ b/include/sqlpp11/sqlite3/connection.h
@@ -159,4 +159,5 @@ namespace sqlpp
serializer_t(const connection& db) : _db(db), _count(1)
{
+ _os.precision (std::numeric_limits<long double>::digits10 + 1);
}shows that the underlying implementation supports higher precision values without issue.
Was this an explicit design choice or are float values just so rare nobody noticed?
Metadata
Metadata
Assignees
Labels
No labels