On Thursday, 13 June, 2019 11:28, Doug <dougf....@comcast.net> wrote:

>It occurs to me that if there are sqlite applications today requiring
>the functionality of -0.0, they have implemented it so that it works
>for their application. Perhaps, they accomplished that by adding a
>flag bit or by some other means.

>So if you do nothing about -0.0, you will break no existing
>applications. Granted, you are not adhering to IEEE-745.

>However, ...

>If you can find anyone who has implemented such an application (using
>-0.0), you could find out how they implemented it. To make sqlite
>adhere to IEEE-745, generate an sqlite application note suggesting
>possible ways an application might implement the functionality.

-0.0 is implemented and supported flawlessly except for TWO failings:
  - "printing" (and all conversions to text) does not output the sign
  - .dump processing does not preserve -0.0 on output

The question is whether or not CONVERSION TO TEXT should preserve the sign.  
Since absolutely no one on the face of the planet who uses SQLite3 where a 
value of -0.0 is of any consequence would be converting floating point values 
yither and from TEXT representation (they would be using them directly via the 
sqlite3_bind_double and sqlite3_column_double interfaces) the question is 
really moot as far as users of SQLite3 depending on the value of -0.0 being 
preserved, because it is being preserved -- except across database .dump 
operations.

The .dump issue needs to be addressed since the purpose of .dump is to dump SQL 
that will re-create the database.  -inf and inf have already been handled, 
SQLite3 does not "do" NaN's, the only other thing that the .dump does not 
preserve is -0.0 simply because .dump does not output -0.0 as -0.0 (though it 
parses -0.0 on input just peachy).

It might be nice for the CLI to output the sign bit as it would make debugging 
simpler (the standard SQLite3 CLI could be used to inspect tables).  The 
drawback is that it will confuse people who do not understand floating point 
anyway.  For those who depend on -0.0, they would not be using the CLI and 
conversion to text anyway.

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.




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

Reply via email to