On 31 Jul 2019, at 11:58pm, Keith Medcalf <kmedc...@dessus.com> wrote:

> it depends on the application of affinity.  If you are storing the floating 
> point value in a column that does not have an affinity (ie, no conversions 
> are performed), then it is stored exactly (except for NaN). Application of 
> affinity (ie, real) will cause the -0.0 to be stored as the integer 0 and 
> thus the sign will be lost on retrieval (as well as the conversion of NaN to 
> NULL).

<https://www.sqlite.org/datatype3.html>

in section 3.2 states "Every table column has a type affinity (one of BLOB, 
TEXT, INTEGER, REAL, or NUMERIC)"

Do you feel that your demonstration (which I find convincing) agrees or 
disagrees with that statement ?  You seem to have found a sixth column 
affinity: none.  Certainly columns declared with no affinity do not behave the 
same as any of the five documented affinities.

Should the documentation be updated ?

What happens if you add a line to your demo code

     for row in db.execute('select x from x ORDER BY x'): print row

Does -0.0 get sorted before or with 0.0 ?  I'd do it myself but I don't know 
Python.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to