Re: [sqlite] Floating point numbers

2012-07-15 Thread Steven E. Harris
Klaas Van Be writes: > More about this: > http://en.wikipedia.org/wiki/IEEE_floating_point Thanks, but the question doesn't have anything to do with the IEEE 754 representation, with which I'm familiar enough. The question here concerns SQLite's new numeric value encoding used in keys, which

[sqlite] Floating point numbers

2012-07-15 Thread Klaas Van Be
Steven E. Harris  wrote: Another one I can't figure out: Value    Exponent E    Significand M (in hex) =   =   == 100.1    2                    03 02 I expect that this should have the digits 01, 00, and 10, yielding:   2 * 01 + 1 = 3  = 0x03   2 * 00 + 1

Re: [sqlite] Floating point numbers

2008-10-06 Thread Eric Minbiole
> Does anyone knows why floating point numbers are truncated when they are > written or read from the database?! SQLite stores real numbers as 8 byte IEEE floats, which can hold approximately 16 significant digits. See: http://www.sqlite.org/datatype3.html You could get slightly more

[sqlite] Floating point numbers

2008-10-06 Thread Andreas Terganov
Hi, Does anyone knows why floating point numbers are truncated when they are written or read from the database?! The following code truncates the number so that precision is lost! rc = sqlite3_exec(db, "create table test_tab (num_row real)", callback, 0, ); if( rc!=SQLITE_OK ){