Thanks for helping (all)!

Well, I compared a casual printf("%f\n",val) with the entry stored in
the database (as REAL). The entry is inserted into the db via
sqlite3_bind_double (prepare/reset/step)

Some examples:
fprintf / database (looked up via .dump on the table)
47.824669 / 47.824669167
47.824676 / 47.824672667
47.824676 / 47.824676

I thought that sqlite would store them as text anyways, but would
allow me to operate with the binding using double values.

Converting the double to a char* via snprintf and using
sqlite3_bind_text works though. I think that I am wrong concerning the
purpose of sqlite3_bind_double here.

--Michael

2009/11/30 Igor Tandetnik <itandet...@mvps.org>:
> Michael Lippautz wrote:
>> I am using sqlite_bind_double on a prepared statement (C API). The
>> insert completes, however, the value stored in the sqlite table is
>> different from the output of a casual printf("%f",..)
>
> How do you determine this? Have you retrieved the value back from the 
> database as a double, printed it the exact same way you did the original, and 
> found the results different? I'll be surprised if the data you get back is 
> not bit-for-bit identical to the data you put in.
>
> Igor Tandetnik
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to