On 31 Jan 2015, at 11:14pm, James K. Lowden <jklow...@schemamania.org> wrote:

> That said, https://www.sqlite.org/datatype3.html says REAL is "stored
> as an 8-byte IEEE floating point number".  I can't see why a
> non-signalling NaN couldn't be stored and interpreted.  You'd need some
> convention for collation, and a function like is_nan() would be helpful
> for WHERE clauses.  

So, having established that NaN and -0 do not make the round trip from a C 
variable through a database and back into a C variable ... at least I think we 
have ...

There's a bit representation for storing NaN in a binary64.  Presumably, if you 
have NaN in a C variable, it's using that representation in memory.

Then you use sqlite3_bind_double() to get this into an SQLite variable, and use 
INSERT to get SQLite to put that into a database.  Do we expect to be able to 
see that pattern by looking through the database file using hexdump ?

Because there's nothing in the SQLite documentation that says it can store 
values like NaN or -0.0.  The documentation just says it can store numbers.  It 
should be possible to find out when the distinction between 0.0 and -0.0 gets 
lost.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to