On 6 Jun 2011, at 4:39am, Sidney Cadot wrote: > Hi Simon, > >> But you were using a SQL command to make the match. > > Well, I was using it to demonstrate some behavior I observed, yes. I > was not "matching values with NULL". But whatever. > >> You executed a SELECT command and got an answer from SQL. That answer does >> not mean >> "The result of the calculation '1.0 / 0.0' is the value NULL." > > That's a bit of a philosophical point. In the context of SQLite, the > expression 1.0 / 0.0 evaluates to something that is representable, > namely NULL, that much is clear. Whether NULL is to be considered a > value is up for debate.
No, it's in the standard. Unfortunately you have to pay to receive the standards document, but in the draft standard at http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt see the top of page 7: "null value (null): A special value, or mark, that is used to indicate the absence of any data value." > It is a bit weird to be able to represent > "that what cannot be represented", so I'd take the IMHO simpler > interpretation of just accepting NULL as a value of any non NOT NULL > domain. > >> because you asked SQL, not a maths library. In this case, it's unknown. >> Because SQLite doesn't know how to do that calculation. > > Accepting that, my question becomes: why does SQLite elect to not know > what to do? The handling of NaN results is special cased in the code > (see http://www.sqlite.org/cvstrac/chngview?cn=5066). Why not just > accept the existence of NaN as a valid floating point value? Postgres, > Mysql, and (from a quick google) Oracle and DB2 do this. SQLite is > really the odd one out, here. Yep. There you have a point. It's arguable that SQLite's implementation of maths should be closer to the IEEE standard. But SQLite being small and light I'm not astounded that it doesn't. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users