Re: [sqlite] Floating point literals

2019-07-31 Thread Simon Slavin
On 1 Aug 2019, at 12:55am, Keith Medcalf wrote: > Columns declared with no affinity behave as if they had been declared with > BLOB infinity and v/v. Okay, so leaving out the affinity just lets it default to BLOB. That clarifies and simplifies things. _

Re: [sqlite] Floating point literals

2019-07-31 Thread Keith Medcalf
On Wednesday, 31 July, 2019 17:29, Simon Slavin wrote: >On 31 Jul 2019, at 11:58pm, Keith Medcalf 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

Re: [sqlite] Floating point literals

2019-07-31 Thread Simon Slavin
On 31 Jul 2019, at 11:58pm, Keith Medcalf 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 (i

Re: [sqlite] Floating point literals

2019-07-31 Thread Donald Shepherd
> >>> db.execute('insert into x values (?)', (0.0,)) > >>> db.execute('insert into x values (?)', (-0.0,)) > >>> for row in db.execute('select x from x'): print row > ... > Row(x=None) > Row(x=inf) > Row(x=-inf) > R

Re: [sqlite] Floating point literals

2019-07-31 Thread Keith Medcalf
insert into x values (?)', (-0.0,)) >>> for row in db.execute('select x from x'): print row ... Row(x=None) Row(x=inf) Row(x=-inf) Row(x=0.0) Row(x=0.0) -- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traff

Re: [sqlite] Floating point literals

2019-07-31 Thread Donald Shepherd
ted 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:

Re: [sqlite] Floating point literals

2019-07-31 Thread Keith Medcalf
andetnik >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

Re: [sqlite] Floating point literals

2019-07-31 Thread Donald Shepherd
t: Wednesday, 31 July, 2019 15:15 > >To: sqlite-users@mailinglists.sqlite.org > >Subject: [sqlite] Floating point literals > > > >Is there a way to pass binary representations of floating point > >numbers to > >a SQL query? If sqlite's internal representation of

Re: [sqlite] Floating point literals

2019-07-31 Thread Keith Medcalf
-- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Eric Reischer >Sent: Wednesday, 31 July, 2019 15:15 >To: sqlite-users@mailinglists.sqlite.org >Subject: [sqlite] Floating point literals > >Is there a way to pass binary representations of

Re: [sqlite] Floating point literals

2019-07-31 Thread Igor Tandetnik
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 t

Re: [sqlite] Floating point literals

2019-07-31 Thread Simon Slavin
On 31 Jul 2019, at 10:15pm, Eric Reischer wrote: > Is there a way to pass binary representations of floating point numbers to a > SQL query? If sqlite's internal representation of floating point numbers is > 8-byte IEEE doubles, it would be convenient to be able to pass the literal > value of

[sqlite] Floating point literals

2019-07-31 Thread Eric Reischer
Is there a way to pass binary representations of floating point numbers to a SQL query? If sqlite's internal representation of floating point numbers is 8-byte IEEE doubles, it would be convenient to be able to pass the literal value of a float or double to the underlying SQL parser without su