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 <slav...@bigfraud.org> wrote:

>
> On 4 Mar 2014, at 4:14am, Donald Shepherd <donald.sheph...@gmail.com>
> 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 instead of =
> > as I expect to be the case?
>
> A glance at those numbers suggests that their units are precise to 1/100th
> of a unit.  The proper reply to your question is that you should be storing
> and manipulating those values multiplied by 100, using integer arithmetic
> and INTEGER columns in your database.  This will mean you never have to
> worry about rounding or slack.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to