The -0.0 is only for conversion to text. Otherwise -0.0 is preserved both on input and output (including input text conversions). It is only the conversion of -0.0 TO text that drops the sign. NaN becomes a NULL (ie, a double is not stored, a NULL value is stored). Everything else is preserved including Inf and -Inf.
-- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-----Original Message----- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Igor Tandetnik >Sent: Wednesday, 31 July, 2019 15:34 >To: sqlite-users@mailinglists.sqlite.org >Subject: Re: [sqlite] Floating point literals > >On 7/31/2019 5:15 PM, Eric Reischer wrote: >> I understand you can *retrieve* a non-quantized value using >sqlite3_column_double(), but I don't see a way to set one without >having to printf() the floating point value. > >sqlite3_bind_double > >> Can this be done using sqlite3_bind_* interfaces, or do they >quantize as well? > >Yes. No; except that I seem to recall it mentioned that NaN is >treated as SQL NULL, and negative zero is normalized to positive >zero. > >> The goal is to copy the straight 8-byte (or precision-extended 4- >byte) IEEE value into the column into the database (where the column >is defined as a FLOAT) without having to build a SQL statement that >has an obscene number of digits in each floating point field. > >That's precisely what bound parameters and sqlite3_bind_X functions >are for. >-- >Igor Tandetnik > > >_______________________________________________ >sqlite-users mailing list >sqlite-users@mailinglists.sqlite.org >http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users