On Tue, Mar 27, 2012 at 03:30:03AM +0100, Simon Slavin scratched on the wall: > > On 27 Mar 2012, at 3:12am, Jay A. Kreibich <j...@kreibi.ch> wrote: > > > On Sun, Mar 25, 2012 at 05:48:01AM +0100, Simon Slavin scratched on the > > wall: > > > >> Can those values be passed from a 'double' C variable ? I believe so. > >> So I see no reason why SQLite shouldn't be storing them. > > > > If, in the sense of "can I arrange the bits that way", then yes. > > However, in the sense of "is this a valid floating point number?" the > > answer is no. > > Okay. That's the heart of the matter: what do we mean by "REAL" in the > documentation. The word "REAL" right next to "IEEE" makes me think it > handles NaN, +Inf and -Inf. But it's not explicitly stated. So fair > point: if you don't claim to handle NaN then you don't have to.
Not do drag things out, but how would you "handle" a NaN? If someone writes a signaling-NaN into the database, the DB will start to throw floating point exceptions, terminating the host process, with almost any calculation. Is that really something anyone would consider "correct" behavior? Sounds more like a great attack vector to me. In the sense that SQLite recognizes NaNs as error conditions and does something other than allow the application to terminate, SQLite *does* "handle" them-- by converting them to a data type SQL already knows and understands-- and has extremely similar concepts and behaviors. > Still, the matter having come up, and us having thrashed it out, I do > think it's worth mentioning what happens with the three 'special' > values. Or removing all mention of IEEE entirely. True enough. Better documentation never hurts. It also means when this issue comes up again in 18 months, we can just point at the docs and say, "documented behavior!" -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable." -- Angela Johnson _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users