Re: [sqlite] Using WHERE clauses with REAL data

2014-03-04 Thread Simon Slavin
On 4 Mar 2014, at 10:33am, Donald Shepherd wrote: > It's a nice idea but that's just some sample values generated by an > emulator. I've compromised and am using round() to limit it to a few > digits after the decimal when doing the comparison. If you're using

Re: [sqlite] Using WHERE clauses with REAL data

2014-03-04 Thread Donald Shepherd
It's a nice idea but that's just some sample values generated by an emulator. I've compromised and am using round() to limit it to a few digits after the decimal when doing the comparison. On 4 March 2014 21:27, Simon Slavin wrote: > > On 4 Mar 2014, at 4:14am, Donald

Re: [sqlite] Using WHERE clauses with REAL data

2014-03-04 Thread Simon Slavin
On 4 Mar 2014, at 4:14am, Donald Shepherd wrote: > It appears that using equals on floating point (REAL) data in WHERE clauses > doesn't necessarily work, presumably because of rounding errors - see below > for an example. Is this the case? Do I need to use BETWEEN

Re: [sqlite] Using WHERE clauses with REAL data

2014-03-03 Thread Christopher Vance
There are a small number of floating point numbers which are almost always exactly testable for equality, namely those you have confidence of exact storage. Positive zero is good, although negative zero sometimes causes problems; you can't always assume they're the same number. Smallish integers

Re: [sqlite] Using WHERE clauses with REAL data

2014-03-03 Thread Donald Shepherd
Thanks for the quick response. That was what I was expecting. Regards, Donald. On 4 March 2014 15:20, Richard Hipp wrote: > On Mon, Mar 3, 2014 at 11:14 PM, Donald Shepherd > wrote: > > > It appears that using equals on floating point (REAL) data

Re: [sqlite] Using WHERE clauses with REAL data

2014-03-03 Thread Richard Hipp
On Mon, Mar 3, 2014 at 11:14 PM, Donald Shepherd wrote: > It appears that using equals on floating point (REAL) data in WHERE clauses > doesn't necessarily work, presumably because of rounding errors - see below > for an example. Is this the case? Do I need to use